first pass at reorg

This commit is contained in:
Don Harper 2024-03-03 22:13:09 -06:00
parent 123d74cb27
commit dbae17bd46
17 changed files with 120 additions and 99 deletions

148
flake.nix
View file

@ -17,108 +17,62 @@
self,
nixpkgs,
nix,
disko,
nixos-hardware,
home-manager,
wayland-pipewire-idle-inhibit,
...
}: {
nixosConfigurations = let
workstation = {
system = "x86_64-linux";
modules = [
./workstation
inputs.home-manager.nixosModules.home-manager
./home
./home/gui
./wm/sway
];
};
server = {
system = "x86_64-linux";
modules = [
./server
inputs.home-manager.nixosModules.home-manager
./home
];
};
}:
let
inputs = { inherit disko home-manager nixpkgs nixos-hardware wayland-pipewire-idle-inhibit; };
genPkgs = system: import nixpkgs { inherit system; config.allowUnfree = true; };
# creates a nixos system config
nixosSystem = system: hostname: username:
let
pkgs = genPkgs system;
in
nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit pkgs;
# lets us use these things in modules
customArgs = { inherit system hostname username pkgs; };
};
modules = [
#disko.nixosModules.disko
./hosts/${hostname}
home-manager.nixosModules.home-manager {
networking.hostName = hostname;
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
#home-manager.users.${username} = { imports = [ ./home/${username}.nix ]; };
}
];
};
in {
fred = inputs.nixpkgs.lib.nixosSystem {
modules = server.modules ++ [
{
networking.hostName = "fred";
}
./hosts/fred
];
};
www2 = inputs.nixpkgs.lib.nixosSystem {
modules = server.modules ++ [
{
networking.hostName = "www2";
}
./hosts/fred
];
};
loki = inputs.nixpkgs.lib.nixosSystem {
modules = workstation.modules ++ [
{
networking.hostName = "loki";
}
./hosts/loki
inputs.nixos-hardware.nixosModules.dell-xps-13-9310
];
};
smaug = inputs.nixpkgs.lib.nixosSystem {
modules = workstation.modules ++ [
{
networking.hostName = "smaug";
}
./hosts/smaug
./hosts/smaug/podman.nix
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-x260
];
};
pocket2 = inputs.nixpkgs.lib.nixosSystem {
modules = workstation.modules ++ [
{
networking.hostName = "pocket2";
}
./hosts/pocket2
inputs.nixos-hardware.nixosModules.common-cpu-intel
inputs.nixos-hardware.nixosModules.common-gpu-intel
inputs.nixos-hardware.nixosModules.common-pc-laptop
inputs.nixos-hardware.nixosModules.common-pc-laptop-ssd
];
};
dragon = inputs.nixpkgs.lib.nixosSystem {
modules = workstation.modules ++ [
{
networking.hostName = "dragon";
}
./hosts/dragon
inputs.nixos-hardware.nixosModules.common-cpu-intel
inputs.nixos-hardware.nixosModules.common-gpu-intel
inputs.nixos-hardware.nixosModules.common-pc-laptop
inputs.nixos-hardware.nixosModules.common-pc-laptop-ssd
];
};
eve = inputs.nixpkgs.lib.nixosSystem {
modules = workstation.modules ++ [
{
networking.hostName = "eve";
}
./hosts/eve
inputs.nixos-hardware.nixosModules.google-pixelbook
];
};
vm2 = inputs.nixpkgs.lib.nixosSystem {
modules = workstation.modules ++ [
{
services.getty.autologinUser = "don";
networking.hostName = "vm2";
}
./hosts/vm1
];
nixosConfigurations = {
# clients
ace = nixosSystem "x86_64-linux" "ace" "don";
dragon = nixosSystem "x86_64-linux" "dragon" "don";
eve = nixosSystem "x86_64-linux" "eve" "don";
loki = nixosSystem "x86_64-linux" "loki" "don";
pocket2 = nixosSystem "x86_64-linux" "pocket2" "don";
smaug = nixosSystem "x86_64-linux" "smaug" "don";
#t2 = nixosSystem "x86_64-linux" "t2" "don";
# servers
display = nixosSystem "x86_64-linux" "display" "don";
harper2 = nixosSystem "x86_64-linux" "harper2" "don";
harper = nixosSystem "x86_64-linux" "harper" "don";
nuwww = nixosSystem "x86_64-linux" "nuwww" "don";
pihole = nixosSystem "x86_64-linux" "pihole" "don";
www2 = nixosSystem "x86_64-linux" "www2" "don";
# test system
# use this for a blank ISO + disko to work
nixos = nixosSystem "x86_64-linux" "nixos" "don";
};
};
};
}

View file

@ -4,5 +4,10 @@
imports =
[
./hardware-configuration.nix
../../workstation
../../home
../../home/gui
../../wm
];
networking.hostName = "ace";
}

View file

@ -4,5 +4,8 @@
imports =
[
./hardware-configuration.nix
../../server
../../home
];
networking.hostName = "display";
}

View file

@ -1,8 +1,17 @@
{ config, pkgs, ... }:
{ inputs, config, pkgs, ... }:
{
imports =
[
./hardware-configuration.nix
#inputs.nixos-hardware.nixosModules.common-cpu-intel
#inputs.nixos-hardware.nixosModules.common-gpu-intel
#inputs.nixos-hardware.nixosModules.common-pc-laptop
#inputs.nixos-hardware.nixosModules.common-pc-laptop-ssd
../../workstation
../../home
../../home/gui
../../wm
];
networking.hostName = "dragon";
}

View file

@ -4,5 +4,10 @@
imports =
[
./hardware-configuration.nix
../../workstation
../../home
../../home/gui
../../wm
];
networking.hostName = "eve";
}

View file

@ -6,4 +6,5 @@
./hardware-configuration.nix
./podman.nix
];
networking.hostName = "fred";
}

View file

@ -4,5 +4,8 @@
imports =
[
./hardware-configuration.nix
../../server
../../home
];
networking.hostName = "harper";
}

View file

@ -4,5 +4,8 @@
imports =
[
./hardware-configuration.nix
../../server
../../home
];
networking.hostName = "harper2";
}

View file

@ -4,5 +4,10 @@
imports =
[
./hardware-configuration.nix
../../workstation
../../home
../../home/gui
../../wm
];
networking.hostName = "loki";
}

View file

@ -4,5 +4,8 @@
imports =
[
./hardware-configuration.nix
../../server
../../home
];
networking.hostName = "nuwww";
}

View file

@ -4,5 +4,8 @@
imports =
[
./hardware-configuration.nix
../../server
../../home
];
networking.hostName = "pihole";
}

View file

@ -1,8 +1,17 @@
{ config, pkgs, ... }:
{ inputs, config, pkgs, ... }:
{
imports =
[
./hardware-configuration.nix
#inputs.nixos-hardware.nixosModules.common-cpu-intel
#inputs.nixos-hardware.nixosModules.common-gpu-intel
#inputs.nixos-hardware.nixosModules.common-pc-laptop
#inputs.nixos-hardware.nixosModules.common-pc-laptop-ssd
../../workstation
../../home
../../home/gui
../../wm
];
networking.hostName = "pocket2";
}

View file

@ -4,5 +4,10 @@
imports =
[
./hardware-configuration.nix
../../workstation
../../home
../../home/gui
../../wm
];
networking.hostName = "smaug";
}

View file

@ -4,5 +4,10 @@
imports =
[
./hardware-configuration.nix
../../workstation
../../home
../../home/gui
../../wm
];
networking.hostName = "t2";
}

View file

@ -5,4 +5,5 @@
[
./hardware-configuration.nix
];
networking.hostName = "vm1";
}

View file

@ -4,5 +4,8 @@
imports =
[
./hardware-configuration.nix
../../server
../../home
];
networking.hostName = "www2";
}

4
wm/default.nix Normal file
View file

@ -0,0 +1,4 @@
{ pkgs, ... }:
{
imports = [ ./sway ];
}