From 97d707555691ab87204fa00d7777cb62a88823e8 Mon Sep 17 00:00:00 2001 From: Patryk Niedźwiedziński Date: Sun, 29 Sep 2024 19:11:26 +0200 Subject: t14: 27 current 2024-09-29 19:11:23 24.05.20240928.fbca5e7 6.6.52 * --- flake.nix | 66 ++++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 36 insertions(+), 30 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index 0db2666..3618e4a 100644 --- a/flake.nix +++ b/flake.nix @@ -11,37 +11,43 @@ nixos-hardware.url = "github:NixOS/nixos-hardware/master"; }; - outputs = { self, nixpkgs, ... }@inputs: { + outputs = { self, nixpkgs, ... }@inputs: + +let + nixosSystem = system: name: nixosModules: nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = {inherit inputs;}; + modules = nixosModules ++ [ + ({ config, ... }: + { + networking.hostName = name; + nix = { + extraOptions = "extra-experimental-features = nix-command flakes"; + }; + }) + ./machines/${name} + ]; + }; + in { nixosConfigurations = { - nixos = nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs;}; - modules = [ - ./machines/x220-gnome/configuration.nix - - inputs.home-manager.nixosModules.default - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.pn = import ./home.nix; - } - - ]; - }; - t14 = nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs;}; - modules = [ - ./machines/t14 - ./modules/gnome.nix - inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t14-amd-gen2 - inputs.home-manager.nixosModules.default - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.pn = import ./home.nix; - } - - ]; - }; + x220-gnome = nixosSystem "x86_64-linux" "x220-gnome" [ + inputs.home-manager.nixosModules.default + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.pn = import ./home.nix; + } + ]; + t14 = nixosSystem "x86_64-linux" "t14" [ + ./modules/gnome.nix + inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t14-amd-gen2 + inputs.home-manager.nixosModules.default + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.pn = import ./home.nix; + } + ]; }; }; } -- cgit 1.4.1