diff --git a/flake.nix b/flake.nix index fd52997..feb97a3 100644 --- a/flake.nix +++ b/flake.nix @@ -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 = { diff --git a/modules/home-manager/common.nix b/modules/home-manager/common.nix index f933921..3c86df4 100644 --- a/modules/home-manager/common.nix +++ b/modules/home-manager/common.nix @@ -15,13 +15,13 @@ bat helix git - iex + # iex zellij broot nnn htop cargo - senpai + # senpai tmux ]; diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index b35db87..a1dcbd8 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -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; diff --git a/modules/home-manager/flanfam.nix b/modules/home-manager/flanfam.nix new file mode 100644 index 0000000..32f5060 --- /dev/null +++ b/modules/home-manager/flanfam.nix @@ -0,0 +1,12 @@ +{...}: { + home-manager = { + users.flanfam = { + imports = [./common.nix]; + home = { + username = "flanfam"; + homeDirectory = "/home/flanfam"; + stateVersion = "23.11"; + }; + }; + }; +} diff --git a/modules/home-manager/flanfamkiosk.nix b/modules/home-manager/flanfamkiosk.nix new file mode 100644 index 0000000..b3bc46c --- /dev/null +++ b/modules/home-manager/flanfamkiosk.nix @@ -0,0 +1,12 @@ +{...}: { + home-manager = { + users.flanfamkiosk = { + imports = [./common.nix]; + home = { + username = "flanfamkiosk"; + homeDirectory = "/home/flanfamkiosk"; + stateVersion = "23.11"; + }; + }; + }; +} diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index 367df2d..6d0b6c5 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -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; } diff --git a/modules/nixos/flanfam.nix b/modules/nixos/flanfam.nix new file mode 100644 index 0000000..1b8aa2d --- /dev/null +++ b/modules/nixos/flanfam.nix @@ -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 = []; + }; + }; +} diff --git a/modules/nixos/flanfamkiosk.nix b/modules/nixos/flanfamkiosk.nix new file mode 100644 index 0000000..11b9256 --- /dev/null +++ b/modules/nixos/flanfamkiosk.nix @@ -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 = []; + }; + }; +} diff --git a/nixos/base/default.nix b/nixos/base/default.nix index 6c06cc1..6d70d4c 100644 --- a/nixos/base/default.nix +++ b/nixos/base/default.nix @@ -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 = { diff --git a/nixos/default.nix b/nixos/default.nix new file mode 100644 index 0000000..4164167 --- /dev/null +++ b/nixos/default.nix @@ -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]) + ]; +} diff --git a/nixos/thablet/default.nix b/nixos/thablet/default.nix index f452cf7..ace98a3 100644 --- a/nixos/thablet/default.nix +++ b/nixos/thablet/default.nix @@ -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";