From ca114f1285ad3f2c66d980adbefc0ce6893bdad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laure=CE=B7t?= Date: Fri, 15 Dec 2023 17:02:50 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=9A=20move=20nixosConfigurations=20out?= =?UTF-8?q?side=20flake.nix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flake.nix | 44 ++---------------------- hosts/default.nix | 44 ++++++++++++++++++++++++ hosts/neodymium/default.nix | 5 ++- hosts/neodymium/home/default.nix | 4 +-- hosts/neodymium/system/users/default.nix | 20 +---------- 5 files changed, 54 insertions(+), 63 deletions(-) create mode 100644 hosts/default.nix diff --git a/flake.nix b/flake.nix index 1278e16..05a6486 100644 --- a/flake.nix +++ b/flake.nix @@ -27,7 +27,6 @@ nixos-hardware.url = "github:nixos/nixos-hardware"; disko.url = "github:nix-community/disko"; nixos-anywhere.url = "github:nix-community/nixos-anywhere"; - # atuin.url = "github:atuinsh/atuin"; pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix"; treefmt-nix.url = "github:numtide/treefmt-nix"; @@ -42,24 +41,19 @@ nixConfig = { extra-substituters = [ "https://nix-community.cachix.org" - "https://pre-commit-hooks.cachix.org" + # "https://pre-commit-hooks.cachix.org" "https://hyprland.cachix.org" ]; extra-trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "pre-commit-hooks.cachix.org-1:Pkk3Panw5AW24TOv6kz3PvLhlH8puAsJTBbOPmBo7Rc=" + # "pre-commit-hooks.cachix.org-1:Pkk3Panw5AW24TOv6kz3PvLhlH8puAsJTBbOPmBo7Rc=" "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" ]; }; outputs = { - nixpkgs, agenix, flake-parts, - lanzaboote, - home-manager, - nixos-hardware, - disko, pre-commit-hooks, treefmt-nix, ... @@ -107,38 +101,6 @@ }; }; - flake.nixosConfigurations = { - # neodymium laptop - neodymium = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = inputs; - modules = [ - ./hosts/neodymium - home-manager.nixosModules.home-manager - agenix.nixosModules.default - lanzaboote.nixosModules.lanzaboote - nixos-hardware.nixosModules.common-cpu-amd - nixos-hardware.nixosModules.common-gpu-nvidia-disable - nixos-hardware.nixosModules.common-pc-laptop - nixos-hardware.nixosModules.common-pc-laptop-ssd - ]; - }; - - # hydrogen vps - hydrogen = nixpkgs.lib.nixosSystem rec { - system = "x86_64-linux"; - specialArgs = { - inherit inputs; - inherit system; - }; - modules = [ - ./hosts/hydrogen - home-manager.nixosModules.home-manager - disko.nixosModules.default - agenix.nixosModules.default - lanzaboote.nixosModules.lanzaboote - ]; - }; - }; + flake.nixosConfigurations = import ./hosts {inherit inputs;}; }; } diff --git a/hosts/default.nix b/hosts/default.nix new file mode 100644 index 0000000..a6878d6 --- /dev/null +++ b/hosts/default.nix @@ -0,0 +1,44 @@ +{inputs, ...}: let + nixpkgs = inputs.nixpkgs; + home-manager = { + useUserPackages = true; + useGlobalPkgs = true; + extraSpecialArgs = { + inherit inputs; + }; + users.laurent = ./neodymium/home; + }; +in { + # neodymium laptop + neodymium = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = inputs; + modules = [ + ./neodymium + inputs.home-manager.nixosModules.home-manager + inputs.agenix.nixosModules.default + inputs.lanzaboote.nixosModules.lanzaboote + inputs.nixos-hardware.nixosModules.common-cpu-amd + inputs.nixos-hardware.nixosModules.common-gpu-nvidia-disable + inputs.nixos-hardware.nixosModules.common-pc-laptop + inputs.nixos-hardware.nixosModules.common-pc-laptop-ssd + {inherit home-manager;} + ]; + }; + + # hydrogen vps + hydrogen = nixpkgs.lib.nixosSystem rec { + system = "x86_64-linux"; + specialArgs = { + inherit inputs; + inherit system; + }; + modules = [ + ./hydrogen + inputs.home-manager.nixosModules.home-manager + inputs.disko.nixosModules.default + inputs.agenix.nixosModules.default + inputs.lanzaboote.nixosModules.lanzaboote + ]; + }; +} diff --git a/hosts/neodymium/default.nix b/hosts/neodymium/default.nix index 62b5f10..689720a 100644 --- a/hosts/neodymium/default.nix +++ b/hosts/neodymium/default.nix @@ -1,5 +1,8 @@ {pkgs, ...}: { - imports = [./system ./services]; + imports = [ + ./system + ./services + ]; # shorter timeout for systemd services systemd.extraConfig = '' diff --git a/hosts/neodymium/home/default.nix b/hosts/neodymium/home/default.nix index a824702..17cd3d3 100644 --- a/hosts/neodymium/home/default.nix +++ b/hosts/neodymium/home/default.nix @@ -1,7 +1,7 @@ -{hyprland, ...}: { +{inputs, ...}: { config.home.stateVersion = "23.05"; imports = [ - hyprland.homeManagerModules.default + inputs.hyprland.homeManagerModules.default ./packages.nix diff --git a/hosts/neodymium/system/users/default.nix b/hosts/neodymium/system/users/default.nix index 7970487..70ecca8 100644 --- a/hosts/neodymium/system/users/default.nix +++ b/hosts/neodymium/system/users/default.nix @@ -1,21 +1,9 @@ -{ - pkgs, - hyprland, - ... -}: { +{pkgs, ...}: { # disable user creation/deletion users.mutableUsers = false; - # setup home-manager - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - extraSpecialArgs = {inherit hyprland;}; - }; - # configure users users = { - # absolute gigachad users.laurent = { isNormalUser = true; initialPassword = "laurent"; @@ -23,10 +11,4 @@ shell = pkgs.zsh; }; }; - - # configure users' home - home-manager = { - # gigachad's home - users.laurent = ../../home; - }; }