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 = [
"aarch64-linux"
# "i686-linux"
"x86_64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
forAllSystems = nixpkgs.lib.genAttrs systems;
color-schemes = (import ./lib/colors.nix inputs).schemes;
colors = color-schemes.catppuccin-mocha-sapphire;
in {
colors = (import ./lib/colors.nix inputs).schemes.catppuccin-mocha-sapphire;
# colors = (import ./lib/colors.nix inputs).color-schemes.donokai;
font = {
name = "IosevkaLyteTerm";
size = 12;
};
in {
colors = colors;
font = font;
# Your custom packages
# Acessible through 'nix build', 'nix shell', etc
@ -86,54 +81,41 @@
# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = let
mkNixosSystem = system: modules: homeManagerModules:
nixpkgs.lib.nixosSystem {
system = system;
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;
};
};
}
];
};
nixosConfigurations = import ./nixos {
base = {
system = "x86_64-linux";
modules = [./nixos/base];
};
base = mkNixosSystem "x86_64-linux" [./nixos/base] [outputs.homeManagerModules.base];
in {
base = base;
nixos = base; # alias
thablet = mkNixosSystem "x86_64-linux" [./nixos/thablet] [outputs.homeManagerModules.base];
thinker = mkNixosSystem "x86_64-linux" [./nixos/thinker] [outputs.homeManagerModules.thinker];
foxtrot = mkNixosSystem "x86_64-linux" [./nixos/foxtrot] [
outputs.homeManagerModules.foxtrot
thablet = {
system = "x86_64-linux";
modules = [./nixos/thablet];
};
thinker = mkNixosSystem "x86_64-linux" [
./nixos/thinker
(danielWithModules [outputs.homeManagerModules.thinker])
];
beefcake =
mkNixosSystem "x86_64-linux" [
inputs.api-lyte-dev.nixosModules.x86_64-linux.api-lyte-dev
./nixos/beefcake
] (with outputs.homeManagerModules; [
linux
]);
rascal = mkNixosSystem "x86_64-linux" [./nixos/rascal] [
outputs.homeManagerModules.linux
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])
];
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
@ -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
diskoConfigurations = import ./disko;
# Flake templates for easily setting up Nix in a project using common patterns I like
templates = import ./templates/all.nix;
# TODO: nix-on-droid for phone terminal usage?
# TODO: nix-darwin for work?
# TODO: nixos ISO?
};
nixConfig = {

View file

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

View file

@ -32,6 +32,9 @@
htop = import ./htop.nix;
senpai = import ./senpai.nix;
flanfam = import ./flanfam.nix;
flanfamkiosk = import ./flanfamkiosk.nix;
base = import ./base.nix;
dragon = import ./dragon.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;
gnome = import ./gnome.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,
outputs,
lib,
@ -11,11 +11,16 @@
[
(modulesPath + "/installer/scan/not-detected.nix")
inputs.disko.nixosModules.disko
flake.diskoConfigurations.standard
# flake.diskoConfigurations.standard
]
++ (with outputs.nixosModules; [
desktop-usage
wifi
++ (
with outputs.nixosModules; [
desktop-usage
wifi
]
)
++ (with outputs.homeManagerModules; [
sway
]);
nixpkgs = {
@ -40,7 +45,7 @@
};
# not necessarily "base", but all my machines are UEFI so...
boot.loader.systemd-boot.enable = true;
# boot.loader.systemd-boot.enable = true;
networking = {
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
gnome
wifi
flanfam
flanfamkiosk
]);
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.kernelModules = [];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
boot.extraModulePackages = with config.boot.kernelPackages; [acpi_call];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";