🚚 move nixosConfigurations outside flake.nix

This commit is contained in:
Laureηt 2023-12-15 17:02:50 +01:00
parent ec5b640f4d
commit ca114f1285
Signed by: Laurent
SSH key fingerprint: SHA256:kZEpW8cMJ54PDeCvOhzreNr4FSh6R13CMGH/POoO8DI
5 changed files with 54 additions and 63 deletions

View file

@ -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;};
};
}

44
hosts/default.nix Normal file
View file

@ -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
];
};
}

View file

@ -1,5 +1,8 @@
{pkgs, ...}: {
imports = [./system ./services];
imports = [
./system
./services
];
# shorter timeout for systemd services
systemd.extraConfig = ''

View file

@ -1,7 +1,7 @@
{hyprland, ...}: {
{inputs, ...}: {
config.home.stateVersion = "23.05";
imports = [
hyprland.homeManagerModules.default
inputs.hyprland.homeManagerModules.default
./packages.nix

View file

@ -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;
};
}