Compare commits
5 Commits
41138ab34a
...
308206d1cc
Author | SHA1 | Date | |
---|---|---|---|
![]() |
308206d1cc | ||
![]() |
8ac235cb8c | ||
![]() |
5170678a25 | ||
![]() |
19cf31b094 | ||
![]() |
4f0024c4f9 |
@ -103,7 +103,7 @@
|
||||
};
|
||||
|
||||
# Automatic garbage collection
|
||||
nix.gc = {
|
||||
nix.gc = lib.mkIf (!config.me.buildingIso) {
|
||||
# Runs nix-collect-garbage --delete-older-than 5d
|
||||
automatic = true;
|
||||
randomizedDelaySec = "14m";
|
||||
@ -136,9 +136,6 @@
|
||||
file
|
||||
usbutils # for lsusb
|
||||
pciutils # for lspci
|
||||
mesa-demos # for glxgears TODO move to better role
|
||||
vulkan-tools # for vkcube TODO move to better role
|
||||
xorg.xeyes # to test which windows are using x11 TODO move to better role
|
||||
ripgrep
|
||||
strace
|
||||
ltrace
|
||||
@ -175,7 +172,6 @@
|
||||
"/var/lib/nixos" # Contains user information (uids/gids)
|
||||
"/var/lib/systemd" # Systemd state directory for random seed, persistent timers, core dumps, persist hardware state like backlight and rfkill
|
||||
"/var/log/journal" # Logs, alternatively set `services.journald.storage = "volatile";` to write to /run/log/journal
|
||||
"/etc/zfs/zpool.cache" # Which zpools to import, the root zpool is already imported and does not need this cache file but this captures additional pools. TODO consider setting cachefile=none on main pool.
|
||||
];
|
||||
files = [
|
||||
"/etc/machine-id" # Systemd unique machine id "otherwise, the system journal may fail to list earlier boots, etc"
|
||||
|
@ -87,7 +87,8 @@
|
||||
// {
|
||||
modules = base_x86_64_linux.modules ++ [
|
||||
(nixpkgs + "/nixos/modules/installer/cd-dvd/iso-image.nix")
|
||||
# TODO: maybe? imports = [ "${modulesPath}/profiles/image-based-appliance.nix" ];
|
||||
# TODO: Figure out how to do image based appliances
|
||||
# (nixpkgs + "/nixos/modules/profiles/image-based-appliance.nix")
|
||||
{
|
||||
isoImage.makeEfiBootable = true;
|
||||
isoImage.makeUsbBootable = true;
|
||||
|
@ -6,6 +6,7 @@
|
||||
./optimized_build.nix
|
||||
./power_management.nix
|
||||
./screen_brightness.nix
|
||||
./wifi.nix
|
||||
];
|
||||
|
||||
# Generate with `head -c4 /dev/urandom | od -A none -t x4`
|
||||
|
16
nix/configuration/hosts/odo/wifi.nix
Normal file
16
nix/configuration/hosts/odo/wifi.nix
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
config = {
|
||||
environment.loginShellInit = lib.mkIf (!config.me.buildingIso) ''
|
||||
doas iw dev wlan0 set power_save off
|
||||
'';
|
||||
};
|
||||
}
|
@ -8,5 +8,36 @@
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
hardware.graphics.enable = true;
|
||||
options.me.graphicsCardType = lib.mkOption {
|
||||
type = lib.types.nullOr (
|
||||
lib.types.enum [
|
||||
"amd"
|
||||
"intel"
|
||||
"nvidia"
|
||||
]
|
||||
);
|
||||
default = null;
|
||||
example = "amd";
|
||||
description = "What graphics card type is in the computer.";
|
||||
};
|
||||
|
||||
options.me.graphical = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = "Whether we want to install graphical programs.";
|
||||
};
|
||||
|
||||
config = (
|
||||
lib.mkMerge [
|
||||
(lib.mkIf config.me.graphical {
|
||||
environment.systemPackages = with pkgs; [
|
||||
mesa-demos # for glxgears
|
||||
vulkan-tools # for vkcube
|
||||
xorg.xeyes # to test which windows are using x11
|
||||
];
|
||||
hardware.graphics.enable = true;
|
||||
})
|
||||
]
|
||||
);
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
lxqt.lxqt-policykit # Need a polkit agent to launch the keyboard configurator
|
||||
];
|
||||
|
||||
# TODO: Switch sway to using seatd instead of polkit
|
||||
systemd = {
|
||||
user.services.lxqt-policykit-agent = {
|
||||
description = "lxqt-policykit-agent";
|
||||
|
@ -21,26 +21,6 @@ in
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
options.me.graphicsCardType = lib.mkOption {
|
||||
type = lib.types.nullOr (
|
||||
lib.types.enum [
|
||||
"amd"
|
||||
"intel"
|
||||
"nvidia"
|
||||
]
|
||||
);
|
||||
default = null;
|
||||
example = "amd";
|
||||
description = "What graphics card type is in the computer.";
|
||||
};
|
||||
|
||||
options.me.graphical = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = "Whether we want to install graphical programs.";
|
||||
};
|
||||
|
||||
config = (
|
||||
lib.mkMerge [
|
||||
{
|
||||
|
@ -258,6 +258,7 @@ in
|
||||
{
|
||||
imports = [
|
||||
./graphical_session_target.nix
|
||||
./iso.nix
|
||||
];
|
||||
|
||||
options.me.swayIncludes = lib.mkOption {
|
||||
@ -383,9 +384,8 @@ in
|
||||
services.gvfs.enable = true;
|
||||
|
||||
# Auto-launch sway
|
||||
environment.loginShellInit = ''
|
||||
# TODO: This shouldn't be shoe-horned into the sway config
|
||||
doas iw dev wlan0 set power_save off
|
||||
# Run sway as the absolute last command in the login shell init. mkBefore = 500, plain = 1000, mkAfter = 1500
|
||||
environment.loginShellInit = lib.mkOrder 2000 ''
|
||||
[ -z "$WAYLAND_DISPLAY" ] && [ -n "$XDG_VTNR" ] && [ "$XDG_VTNR" -eq 1 ] && [ "$(tty)" = "/dev/tty1" ] && exec ${pkgs.systemd}/bin/systemd-cat --identifier=sway sway
|
||||
'';
|
||||
};
|
||||
|
25
nix/configuration/roles/sway/iso.nix
Normal file
25
nix/configuration/roles/sway/iso.nix
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
launch_terminal = pkgs.writeTextFile {
|
||||
name = "launch_terminal.conf";
|
||||
text = ''
|
||||
exec ${pkgs.alacritty}/bin/alacritty
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
config = lib.mkIf (config.me.buildingIso) {
|
||||
# Launch a terminal at boot in the live ISO for when hotkeys don't work.
|
||||
me.swayIncludes = [
|
||||
launch_terminal
|
||||
];
|
||||
};
|
||||
}
|
@ -44,4 +44,11 @@ in
|
||||
zfs_clone_recv
|
||||
zfs_clone_resume
|
||||
];
|
||||
|
||||
environment.persistence."/persist" = lib.mkIf (!config.me.buildingIso) {
|
||||
hideMounts = true;
|
||||
directories = [
|
||||
"/etc/zfs/zpool.cache" # Which zpools to import, the root zpool is already imported and does not need this cache file but this captures additional pools.
|
||||
];
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user