From 82bac88a7bfbd70d8ef1d9461430a885fd47fc00 Mon Sep 17 00:00:00 2001 From: Lillian-Violet Date: Thu, 15 Feb 2024 18:37:06 +0000 Subject: [PATCH 01/17] adding GLaDOS disko config --- configuration.nix | 121 ++++++++++++++++++ disko/GLaDOS/default.nix | 71 ++++++++++ hardware-configuration.nix | 39 ++++++ nixos/hosts/GLaDOS/configuration.nix | 14 ++ nixos/hosts/GLaDOS/hardware-configuration.nix | 33 +++-- 5 files changed, 261 insertions(+), 17 deletions(-) create mode 100644 configuration.nix create mode 100644 disko/GLaDOS/default.nix create mode 100644 hardware-configuration.nix diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..57a9ff3 --- /dev/null +++ b/configuration.nix @@ -0,0 +1,121 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page, on +# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). + +{ config, lib, pkgs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + # networking.hostName = "nixos"; # Define your hostname. + # Pick only one of the below networking options. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + # networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. + + # Set your time zone. + # time.timeZone = "Europe/Amsterdam"; + + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Select internationalisation properties. + # i18n.defaultLocale = "en_US.UTF-8"; + # console = { + # font = "Lat2-Terminus16"; + # keyMap = "us"; + # useXkbConfig = true; # use xkb.options in tty. + # }; + + # Enable the X11 windowing system. + services.xserver.enable = true; + + + # Enable the Plasma 5 Desktop Environment. + services.xserver.displayManager.sddm.enable = true; + services.xserver.desktopManager.plasma5.enable = true; + + + # Configure keymap in X11 + # services.xserver.xkb.layout = "us"; + # services.xserver.xkb.options = "eurosign:e,caps:escape"; + + # Enable CUPS to print documents. + # services.printing.enable = true; + + # Enable sound. + # sound.enable = true; + # hardware.pulseaudio.enable = true; + + # Enable touchpad support (enabled default in most desktopManager). + # services.xserver.libinput.enable = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + # users.users.alice = { + # isNormalUser = true; + # extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + # packages = with pkgs; [ + # firefox + # tree + # ]; + # }; + + # List packages installed in system profile. To search, run: + # $ nix search wget + # environment.systemPackages = with pkgs; [ + # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + # wget + # ]; + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = true; + # }; + + # List services that you want to enable: + + # Enable the OpenSSH daemon. + # services.openssh.enable = true; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # networking.firewall.enable = false; + + # Copy the NixOS configuration file and link it from the resulting system + # (/run/current-system/configuration.nix). This is useful in case you + # accidentally delete configuration.nix. + # system.copySystemConfiguration = true; + + # This option defines the first version of NixOS you have installed on this particular machine, + # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. + # + # Most users should NEVER change this value after the initial install, for any reason, + # even if you've upgraded your system to a new NixOS release. + # + # This value does NOT affect the Nixpkgs version your packages and OS are pulled from, + # so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how + # to actually do that. + # + # This value being lower than the current NixOS release does NOT mean your system is + # out of date, out of support, or vulnerable. + # + # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration, + # and migrated your data accordingly. + # + # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . + system.stateVersion = "24.05"; # Did you read the comment? + +} + diff --git a/disko/GLaDOS/default.nix b/disko/GLaDOS/default.nix new file mode 100644 index 0000000..98a0c8a --- /dev/null +++ b/disko/GLaDOS/default.nix @@ -0,0 +1,71 @@ +{ + disko.devices = { + disk = { + sda1 = { + type = "disk"; + device = "/dev/disk/by-path/pci-0000:06:00.0-ata-6"; + content = { + type = "gpt"; + partitions = { + ESP = { + size = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ + "defaults" + ]; + }; + }; + luks = { + size = "100%"; + content = { + type = "luks"; + name = "crypted"; + extraOpenArgs = []; + settings = { + # if you want to use the key for interactive login be sure there is no trailing newline + # for example use `echo -n "password" > /tmp/secret.key` + #keyFile = "/tmp/secret.key"; + allowDiscards = true; + }; + #additionalKeyFiles = ["/tmp/additionalSecret.key"]; + content = { + type = "lvm_pv"; + vg = "pool"; + }; + }; + }; + }; + }; + }; + }; + lvm_vg = { + pool = { + type = "lvm_vg"; + lvs = { + swap = { + size = "16G"; + content = { + type = "swap"; + resumeDevice = true; # resume from hiberation from this device + }; + }; + root = { + size = "100%FREE"; + content = { + type = "filesystem"; + format = "bcachefs"; + mountpoint = "/"; + mountOptions = [ + "defaults" + ]; + }; + }; + }; + }; + }; + }; +} diff --git a/hardware-configuration.nix b/hardware-configuration.nix new file mode 100644 index 0000000..fdf1ae2 --- /dev/null +++ b/hardware-configuration.nix @@ -0,0 +1,39 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ "dm-snapshot" ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "UUID=166dc8d8-b77f-43fe-8bee-a0fc5b26aeb5"; + fsType = "bcachefs"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/743A-083A"; + fsType = "vfat"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/3d300fda-35d4-4bdb-ac89-21b0f29b167c"; } + ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp3s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/nixos/hosts/GLaDOS/configuration.nix b/nixos/hosts/GLaDOS/configuration.nix index 71ba601..829303e 100644 --- a/nixos/hosts/GLaDOS/configuration.nix +++ b/nixos/hosts/GLaDOS/configuration.nix @@ -24,11 +24,25 @@ ../../desktop + ../../../disko/GLaDOS + # Import your generated (nixos-generate-config) hardware configuration ./hardware-configuration.nix ]; boot.loader.systemd-boot.enable = true; + + # Lanzaboote currently replaces the systemd-boot module. + # This setting is usually set to true in configuration.nix + # generated at installation time. So we force it to false + # for now. + # boot.loader.systemd-boot.enable = lib.mkForce false; + + # boot.lanzaboote = { + # enable = true; + # pkiBundle = "/etc/secureboot"; + # }; + boot.loader.systemd-boot.configurationLimit = 3; boot.loader.efi.canTouchEfiVariables = true; boot.supportedFilesystems = ["bcachefs"]; diff --git a/nixos/hosts/GLaDOS/hardware-configuration.nix b/nixos/hosts/GLaDOS/hardware-configuration.nix index 3b523fc..50c0a1b 100644 --- a/nixos/hosts/GLaDOS/hardware-configuration.nix +++ b/nixos/hosts/GLaDOS/hardware-configuration.nix @@ -8,24 +8,24 @@ [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" ]; + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ "dm-snapshot" ]; + boot.kernelModules = [ ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/14883cd2-72b8-4ab3-8cbf-d5dca40e036a"; - fsType = "ext4"; - }; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/BA43-C24E"; - fsType = "vfat"; - }; - - swapDevices = - [ { device = "/dev/disk/by-uuid/cffe625e-1dac-45bd-a744-303baa09affd"; } - ]; +# fileSystems."/" = +# { device = "UUID=166dc8d8-b77f-43fe-8bee-a0fc5b26aeb5"; +# fsType = "bcachefs"; +# }; +# +# fileSystems."/boot" = +# { device = "/dev/disk/by-uuid/743A-083A"; +# fsType = "vfat"; +# }; +# +# swapDevices = +# [ { device = "/dev/disk/by-uuid/3d300fda-35d4-4bdb-ac89-21b0f29b167c"; } +# ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's @@ -33,7 +33,6 @@ # with explicit per-interface declarations with `networking.interfaces..useDHCP`. networking.useDHCP = lib.mkDefault true; # networking.interfaces.enp3s0.useDHCP = lib.mkDefault true; - # networking.interfaces.wlan0.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; From f7ce86697f0990466b27b6e72835c462250a049e Mon Sep 17 00:00:00 2001 From: Lillian-Violet Date: Thu, 15 Feb 2024 22:17:04 +0100 Subject: [PATCH 02/17] Change bootloader to lanzaboot in GLaDOS --- nixos/hosts/GLaDOS/configuration.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nixos/hosts/GLaDOS/configuration.nix b/nixos/hosts/GLaDOS/configuration.nix index 829303e..cd3c917 100644 --- a/nixos/hosts/GLaDOS/configuration.nix +++ b/nixos/hosts/GLaDOS/configuration.nix @@ -43,6 +43,13 @@ # pkiBundle = "/etc/secureboot"; # }; + boot.loader.systemd-boot.enable = lib.mkForce false; + + boot.lanzaboote = { + enable = true; + pkiBundle = "/etc/secureboot"; + }; + boot.loader.systemd-boot.configurationLimit = 3; boot.loader.efi.canTouchEfiVariables = true; boot.supportedFilesystems = ["bcachefs"]; From 14126751e0252b7d8cd52f5ff0b5594457c7fce3 Mon Sep 17 00:00:00 2001 From: Lillian-Violet Date: Thu, 15 Feb 2024 22:18:23 +0100 Subject: [PATCH 03/17] Need to remove enabling systemdboot --- nixos/hosts/GLaDOS/configuration.nix | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/nixos/hosts/GLaDOS/configuration.nix b/nixos/hosts/GLaDOS/configuration.nix index cd3c917..8d4e254 100644 --- a/nixos/hosts/GLaDOS/configuration.nix +++ b/nixos/hosts/GLaDOS/configuration.nix @@ -30,19 +30,6 @@ ./hardware-configuration.nix ]; - boot.loader.systemd-boot.enable = true; - - # Lanzaboote currently replaces the systemd-boot module. - # This setting is usually set to true in configuration.nix - # generated at installation time. So we force it to false - # for now. - # boot.loader.systemd-boot.enable = lib.mkForce false; - - # boot.lanzaboote = { - # enable = true; - # pkiBundle = "/etc/secureboot"; - # }; - boot.loader.systemd-boot.enable = lib.mkForce false; boot.lanzaboote = { From 7bdfbc45f741c9b8cacf7148958fd05d90e4e7e8 Mon Sep 17 00:00:00 2001 From: Lillian-Violet Date: Thu, 15 Feb 2024 22:19:37 +0100 Subject: [PATCH 04/17] Enable lanzaboot in GLaDOS in the flake --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 937b5f3..08456d5 100644 --- a/flake.nix +++ b/flake.nix @@ -143,7 +143,7 @@ # > Our main nixos configuration file < ./nixos/hosts/GLaDOS/configuration.nix sops-nix.nixosModules.sops - #lanzaboote.nixosModules.lanzaboote + lanzaboote.nixosModules.lanzaboote disko.nixosModules.disko home-manager.nixosModules.home-manager { From 7bcb99f376a175b5f1106be833433861808fc849 Mon Sep 17 00:00:00 2001 From: Lillian-Violet Date: Thu, 15 Feb 2024 22:26:20 +0100 Subject: [PATCH 05/17] Add podman and sbctl to GLaDOS --- nixos/hosts/GLaDOS/configuration.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nixos/hosts/GLaDOS/configuration.nix b/nixos/hosts/GLaDOS/configuration.nix index 8d4e254..517eb5a 100644 --- a/nixos/hosts/GLaDOS/configuration.nix +++ b/nixos/hosts/GLaDOS/configuration.nix @@ -30,6 +30,12 @@ ./hardware-configuration.nix ]; + environment.systemPackages = with pkgs; [ + podman + podman-compose + sbctl + ]; + boot.loader.systemd-boot.enable = lib.mkForce false; boot.lanzaboote = { From ef67bfff5c62d4231d2f949d9ad07bd5d429acaf Mon Sep 17 00:00:00 2001 From: Lillian-Violet Date: Thu, 15 Feb 2024 22:28:25 +0100 Subject: [PATCH 06/17] Add configurationlimit to EDI --- nixos/hosts/EDI/configuration.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixos/hosts/EDI/configuration.nix b/nixos/hosts/EDI/configuration.nix index b665ba5..9f460ef 100644 --- a/nixos/hosts/EDI/configuration.nix +++ b/nixos/hosts/EDI/configuration.nix @@ -65,6 +65,8 @@ enable = true; pkiBundle = "/etc/secureboot"; }; + boot.loader.systemd-boot.configurationLimit = 3; + boot.loader.efi.canTouchEfiVariables = true; # Enable bluetooth hardware hardware.bluetooth.enable = true; From a5d16b602bd07e46e3457254dcad980a83c7b45f Mon Sep 17 00:00:00 2001 From: Lillian-Violet Date: Thu, 15 Feb 2024 23:27:56 +0100 Subject: [PATCH 07/17] Accidentally uploaded these, remove them --- configuration.nix | 121 ------------------------------------- hardware-configuration.nix | 39 ------------ 2 files changed, 160 deletions(-) delete mode 100644 configuration.nix delete mode 100644 hardware-configuration.nix diff --git a/configuration.nix b/configuration.nix deleted file mode 100644 index 57a9ff3..0000000 --- a/configuration.nix +++ /dev/null @@ -1,121 +0,0 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page, on -# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). - -{ config, lib, pkgs, ... }: - -{ - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ]; - - # Use the systemd-boot EFI boot loader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - # networking.hostName = "nixos"; # Define your hostname. - # Pick only one of the below networking options. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - # networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. - - # Set your time zone. - # time.timeZone = "Europe/Amsterdam"; - - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - - # Select internationalisation properties. - # i18n.defaultLocale = "en_US.UTF-8"; - # console = { - # font = "Lat2-Terminus16"; - # keyMap = "us"; - # useXkbConfig = true; # use xkb.options in tty. - # }; - - # Enable the X11 windowing system. - services.xserver.enable = true; - - - # Enable the Plasma 5 Desktop Environment. - services.xserver.displayManager.sddm.enable = true; - services.xserver.desktopManager.plasma5.enable = true; - - - # Configure keymap in X11 - # services.xserver.xkb.layout = "us"; - # services.xserver.xkb.options = "eurosign:e,caps:escape"; - - # Enable CUPS to print documents. - # services.printing.enable = true; - - # Enable sound. - # sound.enable = true; - # hardware.pulseaudio.enable = true; - - # Enable touchpad support (enabled default in most desktopManager). - # services.xserver.libinput.enable = true; - - # Define a user account. Don't forget to set a password with ‘passwd’. - # users.users.alice = { - # isNormalUser = true; - # extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. - # packages = with pkgs; [ - # firefox - # tree - # ]; - # }; - - # List packages installed in system profile. To search, run: - # $ nix search wget - # environment.systemPackages = with pkgs; [ - # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. - # wget - # ]; - - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - # programs.gnupg.agent = { - # enable = true; - # enableSSHSupport = true; - # }; - - # List services that you want to enable: - - # Enable the OpenSSH daemon. - # services.openssh.enable = true; - - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. - # networking.firewall.enable = false; - - # Copy the NixOS configuration file and link it from the resulting system - # (/run/current-system/configuration.nix). This is useful in case you - # accidentally delete configuration.nix. - # system.copySystemConfiguration = true; - - # This option defines the first version of NixOS you have installed on this particular machine, - # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. - # - # Most users should NEVER change this value after the initial install, for any reason, - # even if you've upgraded your system to a new NixOS release. - # - # This value does NOT affect the Nixpkgs version your packages and OS are pulled from, - # so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how - # to actually do that. - # - # This value being lower than the current NixOS release does NOT mean your system is - # out of date, out of support, or vulnerable. - # - # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration, - # and migrated your data accordingly. - # - # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . - system.stateVersion = "24.05"; # Did you read the comment? - -} - diff --git a/hardware-configuration.nix b/hardware-configuration.nix deleted file mode 100644 index fdf1ae2..0000000 --- a/hardware-configuration.nix +++ /dev/null @@ -1,39 +0,0 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - -{ - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ "dm-snapshot" ]; - boot.kernelModules = [ ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "UUID=166dc8d8-b77f-43fe-8bee-a0fc5b26aeb5"; - fsType = "bcachefs"; - }; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/743A-083A"; - fsType = "vfat"; - }; - - swapDevices = - [ { device = "/dev/disk/by-uuid/3d300fda-35d4-4bdb-ac89-21b0f29b167c"; } - ]; - - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp3s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} From e62c4697af725bd79863b802ee010d59956c723b Mon Sep 17 00:00:00 2001 From: Lillian-Violet Date: Fri, 16 Feb 2024 10:20:59 +0100 Subject: [PATCH 08/17] Add v4l2loopback --- nixos/hosts/GLaDOS/configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/hosts/GLaDOS/configuration.nix b/nixos/hosts/GLaDOS/configuration.nix index 517eb5a..369a529 100644 --- a/nixos/hosts/GLaDOS/configuration.nix +++ b/nixos/hosts/GLaDOS/configuration.nix @@ -34,6 +34,7 @@ podman podman-compose sbctl + linuxKernel.packages.linux_latest_libre.v4l2loopback ]; boot.loader.systemd-boot.enable = lib.mkForce false; From f0d377eb5703351e1bc0fa498ef23fa9b60cca64 Mon Sep 17 00:00:00 2001 From: Lillian-Violet Date: Fri, 16 Feb 2024 10:42:37 +0100 Subject: [PATCH 09/17] This instead? --- nixos/hosts/GLaDOS/configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/hosts/GLaDOS/configuration.nix b/nixos/hosts/GLaDOS/configuration.nix index 369a529..c0ecc96 100644 --- a/nixos/hosts/GLaDOS/configuration.nix +++ b/nixos/hosts/GLaDOS/configuration.nix @@ -34,7 +34,6 @@ podman podman-compose sbctl - linuxKernel.packages.linux_latest_libre.v4l2loopback ]; boot.loader.systemd-boot.enable = lib.mkForce false; @@ -47,6 +46,7 @@ boot.loader.systemd-boot.configurationLimit = 3; boot.loader.efi.canTouchEfiVariables = true; boot.supportedFilesystems = ["bcachefs"]; + boot.kernelModules = ["hid-nintendo" "v4l2loopback"]; boot.kernelPackages = pkgs.linuxPackages_latest; home-manager = { From f52e9eddd41483050365889f3e945b563d1a5cb1 Mon Sep 17 00:00:00 2001 From: Lillian-Violet Date: Fri, 16 Feb 2024 10:45:49 +0100 Subject: [PATCH 10/17] Or this? --- nixos/hosts/GLaDOS/configuration.nix | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/nixos/hosts/GLaDOS/configuration.nix b/nixos/hosts/GLaDOS/configuration.nix index c0ecc96..13dcb28 100644 --- a/nixos/hosts/GLaDOS/configuration.nix +++ b/nixos/hosts/GLaDOS/configuration.nix @@ -46,7 +46,20 @@ boot.loader.systemd-boot.configurationLimit = 3; boot.loader.efi.canTouchEfiVariables = true; boot.supportedFilesystems = ["bcachefs"]; - boot.kernelModules = ["hid-nintendo" "v4l2loopback"]; + boot.extraModulePackages = with config.boot.kernelPackages; [v4l2loopback.out]; + boot.kernelModules = [ + # Virtual Camera + "v4l2loopback" + # Virtual Microphone, built-in + "snd-aloop" + ]; + # Set initial kernel module settings + boot.extraModprobeConfig = '' + # exclusive_caps: Skype, Zoom, Teams etc. will only show device when actually streaming + # card_label: Name of virtual camera, how it'll show up in Skype, Zoom, Teams + # https://github.com/umlaeute/v4l2loopback + options v4l2loopback exclusive_caps=1 card_label="Virtual Camera" + ''; boot.kernelPackages = pkgs.linuxPackages_latest; home-manager = { From cf619a9a4da21205da84f69487e51413d199f8e0 Mon Sep 17 00:00:00 2001 From: Lillian-Violet Date: Fri, 16 Feb 2024 12:21:34 +0100 Subject: [PATCH 11/17] Add some obs plugins to GLaDOS --- home-manager/hosts/GLaDOS/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/home-manager/hosts/GLaDOS/default.nix b/home-manager/hosts/GLaDOS/default.nix index c17b81a..8fc718d 100644 --- a/home-manager/hosts/GLaDOS/default.nix +++ b/home-manager/hosts/GLaDOS/default.nix @@ -10,4 +10,12 @@ imports = [ ./lillian.nix ]; + programs.obs-studio = { + enable = true; + plugins = with pkgs.obs-studio-plugins; [ + wlrobs + obs-backgroundremoval + obs-pipewire-audio-capture + ]; + }; } From f9a34d7f3ba1828b5a14e45f4ca424a5ec401cd2 Mon Sep 17 00:00:00 2001 From: Lillian-Violet Date: Fri, 16 Feb 2024 12:23:46 +0100 Subject: [PATCH 12/17] Remove obs from GLaDOS specific and configure it in desktop instead --- home-manager/desktop/default.nix | 10 +++++++++- home-manager/hosts/GLaDOS/default.nix | 8 -------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/home-manager/desktop/default.nix b/home-manager/desktop/default.nix index 4eab3e0..03add67 100644 --- a/home-manager/desktop/default.nix +++ b/home-manager/desktop/default.nix @@ -65,7 +65,6 @@ # Multimedia: freetube - obs-studio vlc # Office applications: @@ -120,6 +119,15 @@ ]; }; + programs.obs-studio = { + enable = true; + plugins = with pkgs.obs-studio-plugins; [ + wlrobs + obs-backgroundremoval + obs-pipewire-audio-capture + ]; + }; + # Enable home-manager and git programs.home-manager.enable = true; programs.git = { diff --git a/home-manager/hosts/GLaDOS/default.nix b/home-manager/hosts/GLaDOS/default.nix index 8fc718d..c17b81a 100644 --- a/home-manager/hosts/GLaDOS/default.nix +++ b/home-manager/hosts/GLaDOS/default.nix @@ -10,12 +10,4 @@ imports = [ ./lillian.nix ]; - programs.obs-studio = { - enable = true; - plugins = with pkgs.obs-studio-plugins; [ - wlrobs - obs-backgroundremoval - obs-pipewire-audio-capture - ]; - }; } From 629b3127c153f8f2fefabc0b5ba3401940a2ade2 Mon Sep 17 00:00:00 2001 From: Lillian-Violet Date: Fri, 16 Feb 2024 12:59:11 +0100 Subject: [PATCH 13/17] GPU drivers for GLaDOS --- nixos/hosts/GLaDOS/configuration.nix | 11 +++++ nixos/hosts/GLaDOS/hardware-configuration.nix | 48 ++++++++++--------- 2 files changed, 37 insertions(+), 22 deletions(-) diff --git a/nixos/hosts/GLaDOS/configuration.nix b/nixos/hosts/GLaDOS/configuration.nix index 13dcb28..44d1364 100644 --- a/nixos/hosts/GLaDOS/configuration.nix +++ b/nixos/hosts/GLaDOS/configuration.nix @@ -36,6 +36,17 @@ sbctl ]; + services.xserver.videoDrivers = ["amdgpu"]; + + # Add vulkan support to GPU + hardware.opengl.extraPackages = with pkgs; [ + amdvlk + ]; + # For 32 bit applications + hardware.opengl.extraPackages32 = with pkgs; [ + driversi686Linux.amdvlk + ]; + boot.loader.systemd-boot.enable = lib.mkForce false; boot.lanzaboote = { diff --git a/nixos/hosts/GLaDOS/hardware-configuration.nix b/nixos/hosts/GLaDOS/hardware-configuration.nix index 50c0a1b..c4ee5ec 100644 --- a/nixos/hosts/GLaDOS/hardware-configuration.nix +++ b/nixos/hosts/GLaDOS/hardware-configuration.nix @@ -1,31 +1,35 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ "dm-snapshot" ]; - boot.kernelModules = [ ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod"]; + boot.initrd.kernelModules = ["dm-snapshot" "amdgpu"]; + boot.kernelModules = []; + boot.extraModulePackages = []; -# fileSystems."/" = -# { device = "UUID=166dc8d8-b77f-43fe-8bee-a0fc5b26aeb5"; -# fsType = "bcachefs"; -# }; -# -# fileSystems."/boot" = -# { device = "/dev/disk/by-uuid/743A-083A"; -# fsType = "vfat"; -# }; -# -# swapDevices = -# [ { device = "/dev/disk/by-uuid/3d300fda-35d4-4bdb-ac89-21b0f29b167c"; } -# ]; + # fileSystems."/" = + # { device = "UUID=166dc8d8-b77f-43fe-8bee-a0fc5b26aeb5"; + # fsType = "bcachefs"; + # }; + # + # fileSystems."/boot" = + # { device = "/dev/disk/by-uuid/743A-083A"; + # fsType = "vfat"; + # }; + # + # swapDevices = + # [ { device = "/dev/disk/by-uuid/3d300fda-35d4-4bdb-ac89-21b0f29b167c"; } + # ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's From 123fc86753e4df7afbaba3a2f6ac3fee457d0185 Mon Sep 17 00:00:00 2001 From: Lillian-Violet Date: Fri, 16 Feb 2024 14:41:36 +0100 Subject: [PATCH 14/17] Add & enable wireplumber --- nixos/desktop/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixos/desktop/default.nix b/nixos/desktop/default.nix index 23cc32c..327f504 100644 --- a/nixos/desktop/default.nix +++ b/nixos/desktop/default.nix @@ -89,6 +89,7 @@ # User tools noisetorch + wireplumber ]; programs.direnv = { @@ -146,6 +147,7 @@ alsa.enable = true; alsa.support32Bit = true; pulse.enable = true; + wireplumber.enable = true; }; programs.noisetorch = { From 0dcc2b9acc4a9e4cba02d585ecda9734b36dee32 Mon Sep 17 00:00:00 2001 From: Lillian-Violet Date: Fri, 16 Feb 2024 21:31:25 +0100 Subject: [PATCH 15/17] Enable pipewire jack --- nixos/desktop/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/desktop/default.nix b/nixos/desktop/default.nix index 327f504..30b88af 100644 --- a/nixos/desktop/default.nix +++ b/nixos/desktop/default.nix @@ -147,6 +147,7 @@ alsa.enable = true; alsa.support32Bit = true; pulse.enable = true; + jack.enable = true; wireplumber.enable = true; }; From ab474a949ced67649e999760880906bf5e050a89 Mon Sep 17 00:00:00 2001 From: Lillian-Violet Date: Mon, 19 Feb 2024 16:20:12 +0100 Subject: [PATCH 16/17] Add qjackctl to GLaDOS --- nixos/hosts/GLaDOS/configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/hosts/GLaDOS/configuration.nix b/nixos/hosts/GLaDOS/configuration.nix index 44d1364..4de3f5b 100644 --- a/nixos/hosts/GLaDOS/configuration.nix +++ b/nixos/hosts/GLaDOS/configuration.nix @@ -34,6 +34,7 @@ podman podman-compose sbctl + qjackctl ]; services.xserver.videoDrivers = ["amdgpu"]; From bf4e708745c31ee64d681b643654b23c5ba72295 Mon Sep 17 00:00:00 2001 From: Lillian-Violet Date: Mon, 19 Feb 2024 16:21:21 +0100 Subject: [PATCH 17/17] Update flake lock --- flake.lock | 90 +++++++++++++++++++++++++++--------------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/flake.lock b/flake.lock index 1dc8276..f2f5b97 100644 --- a/flake.lock +++ b/flake.lock @@ -44,11 +44,11 @@ ] }, "locked": { - "lastModified": 1707524024, - "narHash": "sha256-HmumZ8FuWAAYZrWUKm3N4G4h8nmZ5VUVX+vXLmCJNKM=", + "lastModified": 1708305517, + "narHash": "sha256-WYnEspeTTksC21obnnxWOGOAQbnBD0GES0S0XOLsJjs=", "owner": "nix-community", "repo": "disko", - "rev": "d07de570ba05cec2807d058daaa044f6955720c7", + "rev": "1ae1f57dad13595600dd57b6a55fcbaef6673804", "type": "github" }, "original": { @@ -210,11 +210,11 @@ ] }, "locked": { - "lastModified": 1707683400, - "narHash": "sha256-Zc+J3UO1Xpx+NL8UB6woPHyttEy9cXXtm+0uWwzuYDc=", + "lastModified": 1708294481, + "narHash": "sha256-DZtxmeb4OR7iCaKUUuq05ADV2rX8WReZEF7Tq//W0+Y=", "owner": "nix-community", "repo": "home-manager", - "rev": "21b078306a2ab68748abf72650db313d646cf2ca", + "rev": "a54e05bc12d88ff2df941d0dc1183cb5235fa438", "type": "github" }, "original": { @@ -230,11 +230,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1707567487, - "narHash": "sha256-4VyGscBVW9HX5h0UULi1blX1zSvN20hda/AeZkW40ZI=", + "lastModified": 1708148641, + "narHash": "sha256-UliMMpx84PPA+0mcyBj2yuKNawOX7L4u/wO8j9QGHVk=", "owner": "Jovian-Experiments", "repo": "Jovian-NixOS", - "rev": "f02d975f23e83306ff1ab7ef2920e5da147b2d96", + "rev": "f318a856ff3177fdea6044d6c77dd49992330a31", "type": "github" }, "original": { @@ -254,11 +254,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1707742806, - "narHash": "sha256-rYDoODYqYphsYJBs2EOkDNfLxe6Boq9BGtaCE4tVAI0=", + "lastModified": 1708343641, + "narHash": "sha256-UlTZmvuK18wc2I2Wt//Ry5CHxkbxpbE4ccwaVjix+CE=", "owner": "nix-community", "repo": "lanzaboote", - "rev": "71fb51225c124a84847a01300d605b91ab318621", + "rev": "470ba03c4b80ad57397af84145dc0911dc398f91", "type": "github" }, "original": { @@ -332,11 +332,11 @@ ] }, "locked": { - "lastModified": 1707725560, - "narHash": "sha256-RVdsjx/EoaHzmS0st91xnIFukb6BzFq4edbp6Ld38Us=", + "lastModified": 1707873059, + "narHash": "sha256-simzllUEmzVqmQogcGCorfIbJpodAhgGSr6vuFtd4XQ=", "owner": "nix-community", "repo": "nixos-generators", - "rev": "3b6bde6b879a7b74d00f6870c07fc0b1067fcb8d", + "rev": "0aa24e93f75370454f0e03747b6836ac2a2c9fca", "type": "github" }, "original": { @@ -347,11 +347,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1707711327, - "narHash": "sha256-JaiR0Er0Bx80CT5POOYR1I1tLM7VvC2/ny6mOmkoRQw=", + "lastModified": 1708307464, + "narHash": "sha256-OloBg9ZCoPrPqy8/ZoaoRB4kza3lKhnI0LuZq5xldhg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "01737456dfe4907fb5bdc8af39ac8c6d6b1fb551", + "rev": "a332040396d7e3c47883e9c115c1da485712805e", "type": "github" }, "original": { @@ -409,11 +409,11 @@ }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1707603439, - "narHash": "sha256-LodBVZ3+ehJP2azM5oj+JrhfNAAzmTJ/OwAIOn0RfZ0=", + "lastModified": 1708210246, + "narHash": "sha256-Q8L9XwrBK53fbuuIFMbjKvoV7ixfLFKLw4yV+SD28Y8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d8cd80616c8800feec0cab64331d7c3d5a1a6d98", + "rev": "69405156cffbdf2be50153f13cbdf9a0bea38e49", "type": "github" }, "original": { @@ -425,11 +425,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1707546158, - "narHash": "sha256-nYYJTpzfPMDxI8mzhQsYjIUX+grorqjKEU9Np6Xwy/0=", + "lastModified": 1708118438, + "narHash": "sha256-kk9/0nuVgA220FcqH/D2xaN6uGyHp/zoxPNUmPCMmEE=", "owner": "nixos", "repo": "nixpkgs", - "rev": "d934204a0f8d9198e1e4515dd6fec76a139c87f0", + "rev": "5863c27340ba4de8f83e7e3c023b9599c3cb3c80", "type": "github" }, "original": { @@ -441,11 +441,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1707268954, - "narHash": "sha256-2en1kvde3cJVc3ZnTy8QeD2oKcseLFjYPLKhIGDanQ0=", + "lastModified": 1707689078, + "narHash": "sha256-UUGmRa84ZJHpGZ1WZEBEUOzaPOWG8LZ0yPg1pdDF/yM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f8e2ebd66d097614d51a56a755450d4ae1632df1", + "rev": "f9d39fb9aff0efee4a3d5f4a6d7c17701d38a1d8", "type": "github" }, "original": { @@ -457,11 +457,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1707639604, - "narHash": "sha256-J5ipSdfkbYcYaH3Js2dUf3Of94BWStapdmxpW5wwH1U=", + "lastModified": 1708232726, + "narHash": "sha256-DYuEHWQSBwaJkS2rjLUsKvGgDK8QIVojC3klAUw6uyk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "bdc57436da855500d44e9c1ce7450c0772e1cfa1", + "rev": "35c5863c29ce81199ded8a3384f4979b7793f5dc", "type": "github" }, "original": { @@ -473,11 +473,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1707546158, - "narHash": "sha256-nYYJTpzfPMDxI8mzhQsYjIUX+grorqjKEU9Np6Xwy/0=", + "lastModified": 1708118438, + "narHash": "sha256-kk9/0nuVgA220FcqH/D2xaN6uGyHp/zoxPNUmPCMmEE=", "owner": "nixos", "repo": "nixpkgs", - "rev": "d934204a0f8d9198e1e4515dd6fec76a139c87f0", + "rev": "5863c27340ba4de8f83e7e3c023b9599c3cb3c80", "type": "github" }, "original": { @@ -504,11 +504,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1707451808, - "narHash": "sha256-UwDBUNHNRsYKFJzyTMVMTF5qS4xeJlWoeyJf+6vvamU=", + "lastModified": 1708151420, + "narHash": "sha256-MGT/4aGCWQPQiu6COqJdCj9kSpLPiShgbwpbC38YXC8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "442d407992384ed9c0e6d352de75b69079904e4e", + "rev": "6e2f00c83911461438301db0dba5281197fe4b3a", "type": "github" }, "original": { @@ -585,11 +585,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1707297608, - "narHash": "sha256-ADjo/5VySGlvtCW3qR+vdFF4xM9kJFlRDqcC9ZGI8EA=", + "lastModified": 1708018599, + "narHash": "sha256-M+Ng6+SePmA8g06CmUZWi1AjG2tFBX9WCXElBHEKnyM=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "0db2e67ee49910adfa13010e7f012149660af7f0", + "rev": "5df5a70ad7575f6601d91f0efec95dd9bc619431", "type": "github" }, "original": { @@ -628,11 +628,11 @@ ] }, "locked": { - "lastModified": 1707617562, - "narHash": "sha256-Kk2vv5e4MqKPjelKoYsa6YaUyv3pvjWY9nJSnP2QU9w=", + "lastModified": 1708241671, + "narHash": "sha256-zSulX9tP4R35Y8A842dGSzaHMVP91W2Ry0SXvQKD2BQ=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "a22bbbee9b479c6d95b4819135e856a6d447b3ba", + "rev": "d500e370b26f9b14303cb39bf1509df0a920c8b0", "type": "github" }, "original": { @@ -671,11 +671,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1707748232, - "narHash": "sha256-o9L8jrOemQl/5cYp++0cWdfMLzVljCdHwPFF4N0KZeQ=", + "lastModified": 1708225343, + "narHash": "sha256-Q0uVUOfumc1DcKsIJIfMCHph08MjkOvZxvPb/Vi8hWw=", "owner": "Mic92", "repo": "sops-nix", - "rev": "695275c349bb27f91b2b06cb742510899c887b81", + "rev": "ffed177a9d2c685901781c3c6c9024ae0ffc252b", "type": "github" }, "original": {