This commit is contained in:
albert 2024-04-26 20:49:35 +09:00
parent c5834898fa
commit 2fe122ea54
No known key found for this signature in database
GPG key ID: 64F6C4EB46C4543A
3 changed files with 60 additions and 23 deletions

View file

@ -50,7 +50,7 @@
# Steam Deck configs for NixOS # Steam Deck configs for NixOS
jovian.url = "github:Jovian-Experiments/Jovian-NixOS"; jovian.url = "github:Jovian-Experiments/Jovian-NixOS";
}; };
outputs = { self, nixpkgs, nixpkgs-wayland, home-manager, lanzaboote, nur, sops-nix, doom-emacs, nixos-generators, deploy-rs, ... } @inputs: outputs = { self, nixpkgs, nixpkgs-wayland, home-manager, lanzaboote, nur, sops-nix, doom-emacs, nixos-generators, deploy-rs, jovian, ... } @inputs:
let let
inherit (self) outputs; inherit (self) outputs;
stateVersion = "23.11"; stateVersion = "23.11";
@ -68,7 +68,7 @@
piaware-rpi4 = libx.mkHost { hostname = "piaware-rpi4"; system = "aarch64-linux"; type = "small"; }; piaware-rpi4 = libx.mkHost { hostname = "piaware-rpi4"; system = "aarch64-linux"; type = "small"; };
quitman-rpi4 = libx.mkHost { hostname = "quitman-rpi4"; system = "aarch64-linux"; type = "small"; }; quitman-rpi4 = libx.mkHost { hostname = "quitman-rpi4"; system = "aarch64-linux"; type = "small"; };
bakersfield-rpi4 = libx.mkHost { hostname = "bakersfield-rpi4"; system = "aarch64-linux"; type = "small"; }; bakersfield-rpi4 = libx.mkHost { hostname = "bakersfield-rpi4"; system = "aarch64-linux"; type = "small"; };
steamdeck = libx.mkHost { hostname = "steamdeck"; unfree = true; desktop = "plasma6"; repo = "nixpkgs-unstable"; }; steamdeck = libx.mkDeck { hostname = "steamdeck"; type = "small"; };
}; };
homeConfigurations = { homeConfigurations = {
"albert@osaka-linode-01" = libx.mkHome { hostname = "osaka-linode-01"; type = "small"; }; "albert@osaka-linode-01" = libx.mkHome { hostname = "osaka-linode-01"; type = "small"; };
@ -81,7 +81,7 @@
"albert@piaware-rpi4" = libx.mkHome { hostname = "piaware-rpi4"; system = "aarch64-linux"; type = "small"; }; "albert@piaware-rpi4" = libx.mkHome { hostname = "piaware-rpi4"; system = "aarch64-linux"; type = "small"; };
"albert@quitman-rpi4" = libx.mkHome { hostname = "quitman-rpi4"; system = "aarch64-linux"; type = "small"; }; "albert@quitman-rpi4" = libx.mkHome { hostname = "quitman-rpi4"; system = "aarch64-linux"; type = "small"; };
"albert@bakersfield-rpi4" = libx.mkHome { hostname = "bakersfield-rpi4"; system = "aarch64-linux"; type = "small"; }; "albert@bakersfield-rpi4" = libx.mkHome { hostname = "bakersfield-rpi4"; system = "aarch64-linux"; type = "small"; };
"albert@steamdeck" = libx.mkHome { hostname = "steamdeck"; desktop = "plasma6"; }; "albert@steamdeck" = libx.mkHome { hostname = "steamdeck"; type = "small"; };
# Containers # Containers
"albert@rdesktop" = libx.mkHome { hostname = "rdesktop"; desktop = "xfce"; }; "albert@rdesktop" = libx.mkHome { hostname = "rdesktop"; desktop = "xfce"; };
}; };

View file

@ -68,10 +68,45 @@
imports = [ imports = [
../nixos/containers ../nixos/containers
inputs.sops-nix.nixosModules.sops inputs.sops-nix.nixosModules.sops
inputs.home-manager.nixosModules.home-manager {
home-manager.extraSpecialArgs = { inherit inputs outputs desktop hostname username hmStateVersion stateVersion system theme ; };
home-manager.users."${username}" = import ../home-manager;
}
]; ];
}; };
}; };
# Helper function for generating host configs
mkDeck = {
hostname,
username ? "albert",
desktop ? null,
gpu ? null,
system ? "x86_64-linux",
theme ? "stylix",
type ? "default",
repo ? "nixpkgs-unstable",
unfree ? false
}: inputs.${repo}.lib.nixosSystem {
specialArgs = {
inherit inputs outputs desktop hostname username hmStateVersion stateVersion gpu system theme self;
# Some packages (ie, Vintage Story) I want to keep on unstable no matter what default repo I use
pkgs-unstable = import inputs.nixpkgs-unstable {
inherit system;
config.allowUnfree = unfree;
hostPlatform = system;
};
};
modules = [
# Types are 'default', 'small', and 'minimal'
../nixos/minimal.nix
inputs.sops-nix.nixosModules.sops
inputs.lanzaboote.nixosModules.lanzaboote
];
};
# Helper function for generating host configs # Helper function for generating host configs
mkHost = { mkHost = {
hostname, hostname,
@ -84,26 +119,27 @@
repo ? "nixpkgs", repo ? "nixpkgs",
unfree ? false unfree ? false
}: inputs.${repo}.lib.nixosSystem { }: inputs.${repo}.lib.nixosSystem {
specialArgs = { inherit inputs outputs desktop hostname username hmStateVersion stateVersion gpu system theme self; specialArgs = {
# Choose whether to pull from stable or unstable inherit inputs outputs desktop hostname username hmStateVersion stateVersion gpu system theme self;
pkgs = import inputs.${repo} { # Choose whether to pull from stable or unstable
inherit system; pkgs = import inputs.${repo} {
config.allowUnfree = unfree; inherit system;
hostPlatform = system; config.allowUnfree = unfree;
hostPlatform = system;
};
# Some packages (ie, Vintage Story) I want to keep on unstable no matter what default repo I use
pkgs-unstable = import inputs.nixpkgs-unstable {
inherit system;
config.allowUnfree = unfree;
hostPlatform = system;
};
}; };
# Some packages (ie, Vintage Story) I want to keep on unstable no matter what default repo I use
pkgs-unstable = import inputs.nixpkgs-unstable {
inherit system;
config.allowUnfree = unfree;
hostPlatform = system;
};
};
modules = [ modules = [
# Types are 'default', 'small', and 'minimal' # Types are 'default', 'small', and 'minimal'
../nixos/${type}.nix ../nixos/${type}.nix
inputs.sops-nix.nixosModules.sops inputs.sops-nix.nixosModules.sops
inputs.lanzaboote.nixosModules.lanzaboote inputs.lanzaboote.nixosModules.lanzaboote
]; ];
}; };

View file

@ -6,6 +6,7 @@
../../common/services/tailscale-autoconnect.nix ../../common/services/tailscale-autoconnect.nix
]; ];
nixpkgs.config.allowUnfree = true;
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "thunderbolt" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "thunderbolt" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" "acpi_call" ]; boot.kernelModules = [ "kvm-amd" "acpi_call" ];
@ -27,6 +28,6 @@
steam.user = username; steam.user = username;
steamos.useSteamOSConfig = true; steamos.useSteamOSConfig = true;
devices.steamdeck.enable = true; devices.steamdeck.enable = true;
hardwarhas.amd.gpu = true; hardware.has.amd.gpu = true;
}; };
} }