WIP reorg

This commit is contained in:
Daniel Flanagan 2024-01-04 14:45:10 -06:00
parent 8a9a3ea0cb
commit f44d8ab87d
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4
11 changed files with 171 additions and 66 deletions

View file

@ -46,24 +46,19 @@
systems = [ systems = [
"aarch64-linux" "aarch64-linux"
# "i686-linux"
"x86_64-linux"
"aarch64-darwin" "aarch64-darwin"
"x86_64-darwin" "x86_64-darwin"
]; ];
forAllSystems = nixpkgs.lib.genAttrs systems; forAllSystems = nixpkgs.lib.genAttrs systems;
in {
color-schemes = (import ./lib/colors.nix inputs).schemes; colors = (import ./lib/colors.nix inputs).schemes.catppuccin-mocha-sapphire;
colors = color-schemes.catppuccin-mocha-sapphire;
# colors = (import ./lib/colors.nix inputs).color-schemes.donokai; # colors = (import ./lib/colors.nix inputs).color-schemes.donokai;
font = { font = {
name = "IosevkaLyteTerm"; name = "IosevkaLyteTerm";
size = 12; size = 12;
}; };
in {
colors = colors;
font = font;
# Your custom packages # Your custom packages
# Acessible through 'nix build', 'nix shell', etc # Acessible through 'nix build', 'nix shell', etc
@ -86,54 +81,41 @@
# NixOS configuration entrypoint # NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname' # Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = let nixosConfigurations = import ./nixos {
mkNixosSystem = system: modules: homeManagerModules: base = {
nixpkgs.lib.nixosSystem { system = "x86_64-linux";
system = system; modules = [./nixos/base];
specialArgs = {
inherit inputs outputs system colors font;
flake = self;
};
modules =
[
inputs.sops-nix.nixosModules.sops
self.nixosModules.common
]
++ modules
++ [
inputs.home-manager.nixosModules.home-manager
{
home-manager = {
extraSpecialArgs = {inherit inputs outputs system colors font;};
users.daniel = {
imports = homeManagerModules;
};
};
}
];
}; };
base = mkNixosSystem "x86_64-linux" [./nixos/base] [outputs.homeManagerModules.base]; thablet = {
in { system = "x86_64-linux";
base = base; modules = [./nixos/thablet];
nixos = base; # alias };
thablet = mkNixosSystem "x86_64-linux" [./nixos/thablet] [outputs.homeManagerModules.base]; thinker = mkNixosSystem "x86_64-linux" [
thinker = mkNixosSystem "x86_64-linux" [./nixos/thinker] [outputs.homeManagerModules.thinker]; ./nixos/thinker
foxtrot = mkNixosSystem "x86_64-linux" [./nixos/foxtrot] [ (danielWithModules [outputs.homeManagerModules.thinker])
outputs.homeManagerModules.foxtrot
]; ];
beefcake = foxtrot = mkNixosSystem "x86_64-linux" [
mkNixosSystem "x86_64-linux" [ ./nixos/foxtrot
(danielWithModules [outputs.homeManagerModules.foxtrot])
];
beefcake = mkNixosSystem "x86_64-linux" [
inputs.api-lyte-dev.nixosModules.x86_64-linux.api-lyte-dev inputs.api-lyte-dev.nixosModules.x86_64-linux.api-lyte-dev
./nixos/beefcake ./nixos/beefcake
] (with outputs.homeManagerModules; [ (danielWithModules [outputs.homeManagerModules.linux])
linux ];
]); rascal = mkNixosSystem "x86_64-linux" [
rascal = mkNixosSystem "x86_64-linux" [./nixos/rascal] [ ./nixos/rascal
outputs.homeManagerModules.linux (danielWithModules [outputs.homeManagerModules.linux])
];
musicbox = mkNixosSystem "x86_64-linux" [
./nixos/musicbox
(danielWithModules [outputs.homeManagerModules.sway])
];
router = mkNixosSystem "x86_64-linux" [
./nixos/router
(danielWithModules [outputs.homeManagerModules.common])
]; ];
musicbox = mkNixosSystem "x86_64-linux" [./nixos/musicbox] [outputs.homeManagerModules.sway];
router = mkNixosSystem "x86_64-linux" [./nixos/router] [outputs.homeManagerModules.common];
}; };
# Standalone home-manager configuration entrypoint # Standalone home-manager configuration entrypoint
@ -158,15 +140,15 @@
}; };
}; };
# TODO: nix-on-droid for phone terminal usage?
# TODO: nix-darwin for work?
# TODO: nixos ISO?
# Disk partition schemes and functions # Disk partition schemes and functions
diskoConfigurations = import ./disko; diskoConfigurations = import ./disko;
# Flake templates for easily setting up Nix in a project using common patterns I like # Flake templates for easily setting up Nix in a project using common patterns I like
templates = import ./templates/all.nix; templates = import ./templates/all.nix;
# TODO: nix-on-droid for phone terminal usage?
# TODO: nix-darwin for work?
# TODO: nixos ISO?
}; };
nixConfig = { nixConfig = {

View file

@ -15,13 +15,13 @@
bat bat
helix helix
git git
iex # iex
zellij zellij
broot broot
nnn nnn
htop htop
cargo cargo
senpai # senpai
tmux tmux
]; ];

View file

@ -32,6 +32,9 @@
htop = import ./htop.nix; htop = import ./htop.nix;
senpai = import ./senpai.nix; senpai = import ./senpai.nix;
flanfam = import ./flanfam.nix;
flanfamkiosk = import ./flanfamkiosk.nix;
base = import ./base.nix; base = import ./base.nix;
dragon = import ./dragon.nix; dragon = import ./dragon.nix;
thinker = import ./thinker.nix; thinker = import ./thinker.nix;

View file

@ -0,0 +1,12 @@
{...}: {
home-manager = {
users.flanfam = {
imports = [./common.nix];
home = {
username = "flanfam";
homeDirectory = "/home/flanfam";
stateVersion = "23.11";
};
};
};
}

View file

@ -0,0 +1,12 @@
{...}: {
home-manager = {
users.flanfamkiosk = {
imports = [./common.nix];
home = {
username = "flanfamkiosk";
homeDirectory = "/home/flanfamkiosk";
stateVersion = "23.11";
};
};
};
}

View file

@ -16,4 +16,7 @@
wifi = import ./wifi.nix; wifi = import ./wifi.nix;
gnome = import ./gnome.nix; gnome = import ./gnome.nix;
kde-connect = import ./kde-connect.nix; kde-connect = import ./kde-connect.nix;
flanfam = import ./flanfam.nix;
flanfamkiosk = import ./flanfamkiosk.nix;
} }

17
modules/nixos/flanfam.nix Normal file
View file

@ -0,0 +1,17 @@
{...}: {
users.groups.flanfam = {};
users.users = {
flanfam = {
isNormalUser = true;
home = "/home/flanfam";
createHome = true;
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAPLXOjupz3ScYjgrF+ehrbp9OvGAWQLI6fplX6w9Ijb daniel@lyte.dev"
];
group = "flanfam";
extraGroups = ["users" "video"];
packages = [];
};
};
}

View file

@ -0,0 +1,17 @@
{...}: {
users.groups.flanfamkiosk = {};
users.users = {
flanfamkiosk = {
isNormalUser = true;
home = "/home/flanfamkiosk";
createHome = true;
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAPLXOjupz3ScYjgrF+ehrbp9OvGAWQLI6fplX6w9Ijb daniel@lyte.dev"
];
group = "flanfamkiosk";
extraGroups = ["users" "video"];
packages = [];
};
};
}

View file

@ -1,5 +1,5 @@
{ {
flake, # flake,
inputs, inputs,
outputs, outputs,
lib, lib,
@ -11,11 +11,16 @@
[ [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
inputs.disko.nixosModules.disko inputs.disko.nixosModules.disko
flake.diskoConfigurations.standard # flake.diskoConfigurations.standard
] ]
++ (with outputs.nixosModules; [ ++ (
with outputs.nixosModules; [
desktop-usage desktop-usage
wifi wifi
]
)
++ (with outputs.homeManagerModules; [
sway
]); ]);
nixpkgs = { nixpkgs = {
@ -40,7 +45,7 @@
}; };
# not necessarily "base", but all my machines are UEFI so... # not necessarily "base", but all my machines are UEFI so...
boot.loader.systemd-boot.enable = true; # boot.loader.systemd-boot.enable = true;
networking = { networking = {
firewall = { firewall = {

36
nixos/default.nix Normal file
View file

@ -0,0 +1,36 @@
{
base = {
system = "x86_64-linux";
modules = [./base];
};
thablet = {
system = "x86_64-linux";
modules = [./thablet];
};
thinker = mkNixosSystem "x86_64-linux" [
./nixos/thinker
(danielWithModules [outputs.homeManagerModules.thinker])
];
foxtrot = mkNixosSystem "x86_64-linux" [
./nixos/foxtrot
(danielWithModules [outputs.homeManagerModules.foxtrot])
];
beefcake = mkNixosSystem "x86_64-linux" [
inputs.api-lyte-dev.nixosModules.x86_64-linux.api-lyte-dev
./nixos/beefcake
(danielWithModules [outputs.homeManagerModules.linux])
];
rascal = mkNixosSystem "x86_64-linux" [
./nixos/rascal
(danielWithModules [outputs.homeManagerModules.linux])
];
musicbox = mkNixosSystem "x86_64-linux" [
./nixos/musicbox
(danielWithModules [outputs.homeManagerModules.sway])
];
router = mkNixosSystem "x86_64-linux" [
./nixos/router
(danielWithModules [outputs.homeManagerModules.common])
];
}

View file

@ -18,6 +18,8 @@
desktop-usage desktop-usage
gnome gnome
wifi wifi
flanfam
flanfamkiosk
]); ]);
nixpkgs = { nixpkgs = {
@ -66,10 +68,26 @@
}; };
}; };
# https://wiki.archlinux.org/title/Lenovo_ThinkPad_X1_Yoga_(Gen_3)#Using_acpi_call
systemd.services.activate-touch-hack = {
unitConfig = {
Description = "Touch wake Thinkpad X1 Yoga 3rd gen hack";
After = ["suspend.target" "hibernate.target" "hybrid-sleep.target" "suspend-then-hibernate.target"];
};
serviceConfig = {
ExecStart = ''
/bin/sh -c "echo '\\_SB.PCI0.LPCB.EC._Q2A' > /proc/acpi/call"
'';
};
wantedBy = ["suspend.target" "hibernate.target" "hybrid-sleep.target" "suspend-then-hibernate.target"];
};
boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "usb_storage" "sd_mod"]; boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "usb_storage" "sd_mod"];
boot.initrd.kernelModules = []; boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"]; boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = []; boot.extraModulePackages = with config.boot.kernelPackages; [acpi_call];
networking.useDHCP = lib.mkDefault true; networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";