Compare commits

..

No commits in common. "9b6a6f54d6c6f02e0e86cbbcd047917e2b3a309f" and "80b1246ad87b6a0f48f4629158bbb4c312faa0a7" have entirely different histories.

8 changed files with 191 additions and 176 deletions

View file

@ -1,9 +1,4 @@
{ { lib, config, ... }:
inputs,
lib,
config,
...
}:
let let
# Host submodule type # Host submodule type
@ -137,81 +132,6 @@ in
local-data = lanData; local-data = lanData;
} }
]; ];
# Generates flake.homeConfigurations
mkHomeConfiguration =
{
user,
hostname,
system ? "x86_64-linux",
stateVersion ? "22.05",
nixpkgs ? inputs.nixpkgs, # override with e.g. inputs.nixpkgs-stable
userModules ? [ ],
overlays ? [ inputs.self.overlays.default ],
homeManagerModules ? with inputs.self.modules.homeManager; [
base
cli
],
userDirectory ? "/home/${user}",
}:
inputs.home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.${system};
extraSpecialArgs = {
inherit inputs hostname;
};
modules = [
{ nixpkgs.overlays = overlays; }
{
home = {
username = user;
homeDirectory = userDirectory;
inherit stateVersion;
};
}
((inputs.import-tree.initFilter (p: lib.hasSuffix ".nix" p))
"/${inputs.self}/aspects/users/_${user}"
)
]
++ homeManagerModules
++ userModules;
};
# Generates flake.nixosConfigurations
mkHost =
{
hostname,
system ? "x86_64-linux",
nixpkgs ? inputs.nixpkgs,
overlays ? [
inputs.agenix.overlays.default
inputs.self.overlays.default
],
ephemeralRootDev ? null, # pass rootDevice string to enable, e.g. ephemeralephemeralRootDev = "/dev/mapper/cryptroot"
nixosModules ? with inputs.self.modules.nixos; [
base
cli
user
root
],
extraModules ? [ ],
}:
nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit inputs; };
modules = [
inputs.agenix.nixosModules.default
{ networking.hostName = hostname; }
{ nixpkgs.overlays = overlays; }
((inputs.import-tree.initFilter (p: lib.hasSuffix ".nix" p))
"${inputs.self}/aspects/hosts/_${hostname}"
)
]
++ (lib.optional (ephemeralRootDev != null) (
inputs.self.factory.ephemeral { rootDevice = ephemeralRootDev; }
))
++ nixosModules
++ extraModules;
};
}; };
}; };
} }

View file

@ -1,19 +1,33 @@
{ inputs, ... }: { inputs, lib, ... }:
let
mkHost = inputs.self.lib.mkHost;
in
{ {
flake.nixosConfigurations.alexandria = mkHost { flake.nixosConfigurations.alexandria = inputs.nixpkgs-stable.lib.nixosSystem {
hostname = "alexandria"; system = "x86_64-linux";
nixpkgs = inputs.nixpkgs-stable; specialArgs = { inherit inputs; };
extraModules = with inputs.self.modules.nixos; [ modules = [
# base aspects inputs.agenix.nixosModules.default
{ networking.hostName = "alexandria"; }
{
nixpkgs.overlays = [
inputs.agenix.overlays.default
inputs.self.overlays.default
];
}
((inputs.import-tree.initFilter (p: lib.hasSuffix ".nix" p)) ./_alexandria)
]
++ (with inputs.self.modules.nixos; [
# system aspects
base
cli
server server
# user aspects
user
root
# other aspects # other aspects
fwupd fwupd
libvirtd libvirtd
]; ]);
}; };
} }

View file

@ -1,17 +1,34 @@
{ inputs, ... }: { inputs, lib, ... }:
let
mkHost = inputs.self.lib.mkHost;
in
{ {
flake.nixosConfigurations.io = mkHost { flake.nixosConfigurations.io = inputs.nixpkgs.lib.nixosSystem {
hostname = "io"; system = "x86_64-linux";
ephemeral = "/dev/mapper/cryptroot"; specialArgs = { inherit inputs; };
extraModules = with inputs.self.modules.nixos; [ modules = [
# base aspects inputs.agenix.nixosModules.default
{ networking.hostName = "io"; }
{
nixpkgs.overlays = [
inputs.agenix.overlays.default
inputs.self.overlays.default
];
}
((inputs.import-tree.initFilter (p: lib.hasSuffix ".nix" p)) ./_io)
(inputs.self.factory.ephemeral {
rootDevice = "/dev/mapper/cryptroot";
})
]
++ (with inputs.self.modules.nixos; [
# system aspects
base
cli
desktop desktop
# other aspects
# user aspects
user
root
# Other aspects
ai ai
bluetooth bluetooth
dev dev
@ -19,6 +36,6 @@ in
networkmanager networkmanager
niri niri
podman podman
]; ]);
}; };
} }

View file

@ -1,17 +1,34 @@
{ inputs, ... }: { inputs, lib, ... }:
let
mkHost = inputs.self.lib.mkHost;
in
{ {
flake.nixosConfigurations.rotterdam = mkHost { flake.nixosConfigurations.rotterdam = inputs.nixpkgs.lib.nixosSystem {
hostname = "rotterdam"; system = "x86_64-linux";
ephemeral = "/dev/mapper/cryptroot"; specialArgs = { inherit inputs; };
extraModules = with inputs.self.modules.nixos; [ modules = [
# base aspects inputs.agenix.nixosModules.default
{ networking.hostName = "rotterdam"; }
{
nixpkgs.overlays = [
inputs.agenix.overlays.default
inputs.self.overlays.default
];
}
((inputs.import-tree.initFilter (p: lib.hasSuffix ".nix" p)) ./_rotterdam)
(inputs.self.factory.ephemeral {
rootDevice = "/dev/mapper/cryptroot";
})
]
++ (with inputs.self.modules.nixos; [
# system aspects
base
cli
desktop desktop
gaming gaming
# user aspects
user
root
# other aspects # other aspects
ai ai
bluetooth bluetooth
@ -21,6 +38,6 @@ in
networkmanager networkmanager
niri niri
podman podman
]; ]);
}; };
} }

View file

@ -1,18 +1,31 @@
{ inputs, ... }: { inputs, lib, ... }:
let
mkHost = inputs.self.lib.mkHost;
in
{ {
flake.nixosConfigurations.trantor = mkHost { flake.nixosConfigurations.trantor = inputs.nixpkgs-stable.lib.nixosSystem {
hostname = "trantor";
system = "aarch64-linux"; system = "aarch64-linux";
nixpkgs = inputs.nixpkgs-stable; specialArgs = { inherit inputs; };
ephemeral = "/dev/disk/by-id/scsi-360b207ed25d84372a95d1ecf842f8e20-part2"; modules = [
extraModules = with inputs.self.modules.nixos; [ inputs.agenix.nixosModules.default
# base aspects { networking.hostName = "trantor"; }
{
nixpkgs.overlays = [
inputs.agenix.overlays.default
inputs.self.overlays.default
];
}
((inputs.import-tree.initFilter (p: lib.hasSuffix ".nix" p)) ./_trantor)
(inputs.self.factory.ephemeral {
rootDevice = "/dev/disk/by-id/scsi-360b207ed25d84372a95d1ecf842f8e20-part2";
})
]
++ (with inputs.self.modules.nixos; [
# system aspects
base
cli
server server
];
# user aspects
user
root
]);
}; };
} }

View file

@ -1,55 +1,22 @@
{ inputs, ... }: { ... }:
let
mkHomeConfiguration = inputs.self.lib.mkHomeConfiguration;
in
{ {
flake = { flake.modules.nixos.user =
modules.nixos.user = { pkgs, ... }:
{ pkgs, ... }: {
{ users.users.user = {
users.users.user = { isNormalUser = true;
isNormalUser = true; shell = pkgs.fish;
shell = pkgs.fish; extraGroups = [
extraGroups = [ "networkmanager"
"networkmanager" "wheel"
"wheel"
];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICQPkAyy+Du9Omc2WtnUF2TV8jFAF4H6mJi2D4IZ1nzg user@himalia"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO3Y0PVpGfJHonqDS7qoCFhqzUvqGq9I9sax+F9e/5cs user@io"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA1v3+q3EaruiiStWjubEJWvtejam/r41uoOpCdwJtLL user@rotterdam"
];
hashedPassword = "$6$Pj7v/CpstyuWQQV0$cNujVDhfMBdwlGVEnnd8t71.kZPixbo0u25cd.874iaqLTH4V5fa1f98V5zGapjQCz5JyZmsR94xi00sUrntT0";
};
};
homeConfigurations = {
"user@rotterdam" = mkHomeConfiguration {
user = "user";
hostname = "rotterdam";
userModules = with inputs.self.modules.homeManager; [
# system aspects
desktop
gaming
# other aspects
stylix
niri
]; ];
}; openssh.authorizedKeys.keys = [
"user@io" = mkHomeConfiguration { "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICQPkAyy+Du9Omc2WtnUF2TV8jFAF4H6mJi2D4IZ1nzg user@himalia"
user = "user"; "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO3Y0PVpGfJHonqDS7qoCFhqzUvqGq9I9sax+F9e/5cs user@io"
hostname = "io"; "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA1v3+q3EaruiiStWjubEJWvtejam/r41uoOpCdwJtLL user@rotterdam"
userModules = with inputs.self.modules.homeManager; [
# system aspects
desktop
# other aspects
stylix
niri
]; ];
hashedPassword = "$6$Pj7v/CpstyuWQQV0$cNujVDhfMBdwlGVEnnd8t71.kZPixbo0u25cd.874iaqLTH4V5fa1f98V5zGapjQCz5JyZmsR94xi00sUrntT0";
}; };
}; };
};
} }

32
aspects/users/user_io.nix Normal file
View file

@ -0,0 +1,32 @@
{ inputs, lib, ... }:
{
flake."user@io" = inputs.home-manager.lib.homeManagerConfiguration {
pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = {
inherit inputs;
hostname = "io";
};
modules = [
{ nixpkgs.overlays = [ inputs.self.overlays.default ]; }
{
home = {
username = "user";
homeDirectory = "/home/user";
stateVersion = "22.05";
};
}
((inputs.import-tree.initFilter (p: lib.hasSuffix ".nix" p)) ./_user)
]
++ (with inputs.self.modules.homeManager; [
# system aspects
base
cli
desktop
# other aspect
stylix
niri
]);
};
}

View file

@ -0,0 +1,35 @@
{ inputs, lib, ... }:
{
flake.homeConfigurations = {
"user@rotterdam" = inputs.home-manager.lib.homeManagerConfiguration {
pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = {
inherit inputs;
hostname = "rotterdam";
};
modules = [
{ nixpkgs.overlays = [ inputs.self.overlays.default ]; }
{
home = {
username = "user";
homeDirectory = "/home/user";
stateVersion = "22.05";
};
}
((inputs.import-tree.initFilter (p: lib.hasSuffix ".nix" p)) ./_user)
]
++ (with inputs.self.modules.homeManager; [
# system aspects
base
cli
desktop
gaming
# other aspects
stylix
niri
]);
};
};
}