From 000ef1fb2c627962c070cf22e002edf14cf92aa5 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Thu, 4 Jan 2024 17:20:02 -0600 Subject: [PATCH] Progress on organization --- flake.nix | 95 ++++++--------- modules/home-manager/common.nix | 18 +-- modules/home-manager/default.nix | 76 ++++++------ modules/home-manager/fish.nix | 8 +- modules/home-manager/linux.nix | 4 +- modules/nixos/avahi.nix | 9 ++ modules/nixos/common.nix | 122 ++++++++++++------- modules/nixos/daniel.nix | 35 ++++++ modules/nixos/default.nix | 47 +++---- modules/nixos/printing.nix | 13 ++ modules/nixos/sway.nix | 8 +- nixos/base.nix | 14 +++ nixos/base/default.nix | 60 --------- nixos/{beefcake/default.nix => beefcake.nix} | 0 nixos/default.nix | 57 +++------ nixos/dragon.nix | 73 +++++++++++ nixos/dragon/default.nix | 120 ------------------ nixos/{foxtrot/default.nix => foxtrot.nix} | 17 --- nixos/{musicbox/default.nix => musicbox.nix} | 0 nixos/{rascal/default.nix => rascal.nix} | 0 nixos/{router/default.nix => router.nix} | 0 nixos/{thablet/default.nix => thablet.nix} | 2 - nixos/{thinker/default.nix => thinker.nix} | 0 23 files changed, 354 insertions(+), 424 deletions(-) create mode 100644 modules/nixos/avahi.nix create mode 100644 modules/nixos/daniel.nix create mode 100644 modules/nixos/printing.nix create mode 100644 nixos/base.nix delete mode 100644 nixos/base/default.nix rename nixos/{beefcake/default.nix => beefcake.nix} (100%) create mode 100644 nixos/dragon.nix delete mode 100644 nixos/dragon/default.nix rename nixos/{foxtrot/default.nix => foxtrot.nix} (92%) rename nixos/{musicbox/default.nix => musicbox.nix} (100%) rename nixos/{rascal/default.nix => rascal.nix} (100%) rename nixos/{router/default.nix => router.nix} (100%) rename nixos/{thablet/default.nix => thablet.nix} (95%) rename nixos/{thinker/default.nix => thinker.nix} (100%) diff --git a/flake.nix b/flake.nix index 6a7ff5d..ac8e02e 100644 --- a/flake.nix +++ b/flake.nix @@ -27,13 +27,8 @@ ssbm.url = "github:lytedev/ssbm-nix/my-nixpkgs"; ssbm.inputs.nixpkgs.follows = "nixpkgs"; - # doesn't support the forge mod loader yet + # TODO: doesn't support the forge mod loader yet # nix-minecraft.url = "github:Infinidoge/nix-minecraft"; - - # need to bump ishiiruka upstream I think - # slippi-desktop.url = "github:project-slippi/slippi-desktop-app"; - # slippi-desktop.flake = false; - # ssbm.inputs.slippi-desktop.follows = "slippi-desktop"; }; outputs = { @@ -81,63 +76,47 @@ # NixOS configuration entrypoint # Available through 'nixos-rebuild --flake .#your-hostname' - nixosConfigurations = builtins.mapAttrs (name: {}: (import ./nixos) { - base = { - system = "x86_64-linux"; - modules = [./nixos/base]; - }; - - thablet = { - system = "x86_64-linux"; - modules = [./nixos/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]) - ]; - }; + nixosConfigurations = builtins.mapAttrs (name: { + system, + modules, + ... + }: + nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = { + inherit inputs outputs system; + inherit (outputs) colors font; + flake = self; + }; + modules = + [ + self.nixosModules.common + ] + ++ modules; + }) (import ./nixos); # Standalone home-manager configuration entrypoint # Available through 'home-manager --flake .#your-username@your-hostname' homeConfigurations = { # TODO: non-system-specific home configurations? - "base-x86_64-linux" = let - system = "x86_64-linux"; - in - home-manager.lib.homeManagerConfiguration { - pkgs = nixpkgs.legacyPackages.${system}; - extraSpecialArgs = {inherit inputs outputs system colors font;}; - modules = with outputs.homeManagerModules; [linux]; - }; - "base-aarch64-darwin" = let - system = "aarch64-darwin"; - in - home-manager.lib.homeManagerConfiguration { - pkgs = nixpkgs.legacyPackages.${system}; - extraSpecialArgs = {inherit inputs outputs system colors font;}; - modules = with outputs.homeManagerModules; [macos]; - }; + # "base-x86_64-linux" = let + # system = "x86_64-linux"; + # in + # home-manager.lib.homeManagerConfiguration { + # pkgs = nixpkgs.legacyPackages.${system}; + # extraSpecialArgs = { + # inherit inputs outputs system; + # }; + # modules = with outputs.homeManagerModules; [linux]; + # }; + # "base-aarch64-darwin" = let + # system = "aarch64-darwin"; + # in + # home-manager.lib.homeManagerConfiguration { + # pkgs = nixpkgs.legacyPackages.${system}; + # extraSpecialArgs = {inherit inputs outputs system colors font;}; + # modules = with outputs.homeManagerModules; [macos]; + # }; }; # Disk partition schemes and functions diff --git a/modules/home-manager/common.nix b/modules/home-manager/common.nix index 3c86df4..5c45b71 100644 --- a/modules/home-manager/common.nix +++ b/modules/home-manager/common.nix @@ -15,26 +15,16 @@ bat helix git - # iex zellij broot nnn htop - cargo - # senpai tmux ]; - # TODO: specify an email? - # accounts.email.accounts = { - # primary = { - # address = "daniel@lyte.dev"; - # }; - # }; - home = { - username = lib.mkDefault "daniel"; - homeDirectory = lib.mkDefault "/home/daniel/.home"; + username = lib.mkDefault "lytedev"; + homeDirectory = lib.mkDefault "/home/lytedev"; stateVersion = lib.mkDefault "23.11"; sessionVariables = { @@ -45,9 +35,6 @@ }; packages = [ - # I use gawk for my fish prompt - pkgs.gawk - # text editor inputs.helix.packages.${system}.helix @@ -55,6 +42,7 @@ pkgs.nil pkgs.alejandra + # common scripts (pkgs.buildEnv { name = "my-scripts-common"; paths = [./scripts/common]; diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index a1dcbd8..66c6607 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -1,42 +1,34 @@ -# Add your reusable home-manager modules to this directory, on their own file (https://nixos.wiki/wiki/Module). -# These should be stuff you would like to share with others, not your personal configurations. -{ - # List your module files here - # my-module = import ./my-module.nix; - common = import ./common.nix; - melee = import ./melee.nix; - linux = import ./linux.nix; - cargo = import ./cargo.nix; - macos = import ./macos.nix; - iex = import ./iex.nix; - mako = import ./mako.nix; - git = import ./git.nix; - helix = import ./helix.nix; - bat = import ./bat.nix; - fish = import ./fish.nix; - kitty = import ./kitty.nix; - wezterm = import ./wezterm.nix; - zellij = import ./zellij.nix; - firefox = import ./firefox.nix; - broot = import ./broot.nix; - nnn = import ./nnn.nix; - waybar = import ./waybar.nix; - swaylock = import ./swaylock.nix; - desktop = import ./desktop.nix; - linux-desktop = import ./linux-desktop.nix; - sway = import ./sway.nix; - hyprland = import ./hyprland.nix; - ewwbar = import ./ewwbar.nix; - sway-laptop = import ./sway-laptop.nix; - tmux = import ./tmux.nix; - 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; - foxtrot = import ./foxtrot.nix; -} +with builtins; + listToAttrs (map (name: { + name = name; + value = import ./${name}.nix; + }) [ + "common" + "melee" + "linux" + "cargo" + "macos" + "iex" + "mako" + "git" + "helix" + "bat" + "fish" + "kitty" + "wezterm" + "zellij" + "firefox" + "broot" + "nnn" + "waybar" + "swaylock" + "desktop" + "linux-desktop" + "sway" + "hyprland" + "ewwbar" + "sway-laptop" + "tmux" + "htop" + "senpai" + ]) diff --git a/modules/home-manager/fish.nix b/modules/home-manager/fish.nix index 7f68659..b6dc153 100644 --- a/modules/home-manager/fish.nix +++ b/modules/home-manager/fish.nix @@ -1,4 +1,10 @@ -{ +{pkgs, ...}: { + home = { + packages = [ + pkgs.gawk # used in prompt + ]; + }; + programs.fish = { enable = true; # I load long scripts from files for a better editing experience diff --git a/modules/home-manager/linux.nix b/modules/home-manager/linux.nix index c89c32f..9d8a8f8 100644 --- a/modules/home-manager/linux.nix +++ b/modules/home-manager/linux.nix @@ -3,9 +3,7 @@ pkgs, ... }: { - imports = with outputs.homeManagerModules; [ - common - ]; + imports = with outputs.homeManagerModules; [common]; home = { sessionVariables = { diff --git a/modules/nixos/avahi.nix b/modules/nixos/avahi.nix new file mode 100644 index 0000000..f64adc9 --- /dev/null +++ b/modules/nixos/avahi.nix @@ -0,0 +1,9 @@ +{ + # enable mDNS and discovery + services.avahi = { + enable = true; + reflector = true; + openFirewall = true; + nssmdns = true; + }; +} diff --git a/modules/nixos/common.nix b/modules/nixos/common.nix index 35413ad..b4aa3b6 100644 --- a/modules/nixos/common.nix +++ b/modules/nixos/common.nix @@ -3,16 +3,25 @@ lib, inputs, colors, - # outputs, + outputs, system, pkgs, + modulesPath, ... }: { networking.hostName = lib.mkDefault "nixoslyte"; - imports = [ - inputs.home-manager.nixosModules.home-manager - ]; + imports = + [ + (modulesPath + "/installer/scan/not-detected.nix") + # inputs.sops-nix.nixosModules.sops + inputs.disko.nixosModules.disko + inputs.home-manager.nixosModules.home-manager + ] + ++ (with outputs.nixosModules; [ + avahi + # daniel + ]); hardware.enableRedistributableFirmware = true; @@ -177,44 +186,6 @@ ''; }; - nix = { - settings = { - trusted-users = ["root" "daniel"]; - experimental-features = lib.mkDefault ["nix-command" "flakes"]; - substituters = [ - "https://cache.nixos.org/" - "https://helix.cachix.org" - "https://nix-community.cachix.org" - "https://nix.h.lyte.dev" - ]; - trusted-public-keys = [ - "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" - "helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs=" - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "h.lyte.dev:HeVWtne31ZG8iMf+c15VY3/Mky/4ufXlfTpT8+4Xbs0=" - ]; - }; - - registry = { - self.flake = inputs.self; - - nixpkgs = { - from = { - id = "nixpkgs"; - type = "indirect"; - }; - flake = inputs.nixpkgs; - }; - }; - }; - - nixpkgs = { - config = { - allowUnfree = true; - }; - hostPlatform = lib.mkDefault "x86_64-linux"; - }; - programs = { fish = { enable = true; @@ -254,4 +225,71 @@ # # ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="2e3c", ATTRS{idProduct}=="df11", MODE="0664", GROUP="uucp" # # ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0664", GROUP="uucp"' # ''; + + nixpkgs = { + # You can add overlays here + overlays = [ + # Add overlays your own flake exports (from overlays and pkgs dir): + outputs.overlays.additions + outputs.overlays.modifications + outputs.overlays.unstable-packages + + # You can also add overlays exported from other flakes: + # neovim-nightly-overlay.overlays.default + + # Or define it inline, for example: + # (final: prev: { + # hi = final.hello.overrideAttrs (oldAttrs: { + # patches = [ ./change-hello-to-hi.patch ]; + # }); + # }) + ]; + # Configure your nixpkgs instance + config = { + # Disable if you don't want unfree packages + allowUnfree = true; + }; + }; + + nix = { + # This will add each flake input as a registry + # To make nix3 commands consistent with your flake + registry = lib.mapAttrs (_: value: {flake = value;}) inputs; + + # This will additionally add your inputs to the system's legacy channels + # Making legacy nix commands consistent as well, awesome! + nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry; + + settings = { + trusted-users = ["root" "daniel"]; + experimental-features = lib.mkDefault ["nix-command" "flakes"]; + substituters = [ + "https://cache.nixos.org/" + "https://helix.cachix.org" + "https://nix-community.cachix.org" + "https://nix.h.lyte.dev" + ]; + trusted-public-keys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "h.lyte.dev:HeVWtne31ZG8iMf+c15VY3/Mky/4ufXlfTpT8+4Xbs0=" + ]; + auto-optimise-store = true; + }; + + # registry = { + # self.flake = inputs.self; + + # nixpkgs = { + # from = { + # id = "nixpkgs"; + # type = "indirect"; + # }; + # flake = inputs.nixpkgs; + # }; + # }; + }; + + system.stateVersion = lib.mkDefault "23.11"; } diff --git a/modules/nixos/daniel.nix b/modules/nixos/daniel.nix new file mode 100644 index 0000000..1f7f6d1 --- /dev/null +++ b/modules/nixos/daniel.nix @@ -0,0 +1,35 @@ +{outputs, ...}: { + home-manager = { + users.daniel = { + # TODO: specify an email? + accounts.email.accounts = { + primary = { + address = "daniel@lyte.dev"; + }; + legacy = { + address = "wraithx2@gmail.com"; + }; + io = { + # TODO: finalize deprecation + address = "daniel@lytedev.io"; + }; + # TODO: may need to use a sops secret? put in another module? + # work = { + # address = "REDACTED"; + # }; + }; + + home = { + username = "daniel"; + homeDirectory = "/home/daniel/.home"; + }; + + imports = with outputs.homeManagerModules; [ + common + senpai + iex + cargo + ]; + }; + }; +} diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index 6d0b6c5..d87d117 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -1,22 +1,27 @@ -# Add your reusable NixOS modules to this directory, on their own file (https://nixos.wiki/wiki/Module). -# These should be stuff you would like to share with others, not your personal configurations. -{ - common = import ./common.nix; - melee = import ./melee.nix; - ewwbar = import ./ewwbar.nix; - desktop-usage = import ./desktop-usage.nix; - intel = import ./intel.nix; - pipewire = import ./pipewire.nix; - pipewire-low-latency = import ./pipewire-low-latency.nix; - podman = import ./podman.nix; - postgres = import ./postgres.nix; - sway = import ./sway.nix; - hyprland = import ./hyprland.nix; - user-installed-applications = import ./user-installed-applications.nix; - wifi = import ./wifi.nix; - gnome = import ./gnome.nix; - kde-connect = import ./kde-connect.nix; +with builtins; + listToAttrs (map (name: { + name = name; + value = import ./${name}.nix; + }) [ + "common" + "melee" + "ewwbar" + "desktop-usage" + "intel" + "pipewire" + "pipewire" + "podman" + "postgres" + "sway" + "hyprland" + "user-installed-applications" + "wifi" + "gnome" + "kde-connect" + "printing" + "avahi" - flanfam = import ./flanfam.nix; - flanfamkiosk = import ./flanfamkiosk.nix; -} + "daniel" + "flanfam" + "flanfamkiosk" + ]) diff --git a/modules/nixos/printing.nix b/modules/nixos/printing.nix new file mode 100644 index 0000000..11ddffc --- /dev/null +++ b/modules/nixos/printing.nix @@ -0,0 +1,13 @@ +{pkgs, ...}: { + services.printing.enable = true; + services.printing.browsing = true; + services.printing.browsedConf = '' + BrowseDNSSDSubTypes _cups,_print + BrowseLocalProtocols all + BrowseRemoteProtocols all + CreateIPPPrinterQueues All + + BrowseProtocols all + ''; + services.printing.drivers = [pkgs.gutenprint]; +} diff --git a/modules/nixos/sway.nix b/modules/nixos/sway.nix index d908220..9855e23 100644 --- a/modules/nixos/sway.nix +++ b/modules/nixos/sway.nix @@ -1,5 +1,9 @@ -{pkgs, ...}: { - imports = [./pipewire.nix]; +{ + pkgs, + outputs, + ... +}: { + imports = with outputs.nixosModules; [pipewire]; # services.xserver.libinput.enable = true; diff --git a/nixos/base.nix b/nixos/base.nix new file mode 100644 index 0000000..7a3e3ac --- /dev/null +++ b/nixos/base.nix @@ -0,0 +1,14 @@ +{ + outputs, + flake, + ... +}: { + # a minimal, familiar setup that I can bootstrap atop + imports = with outputs.nixosModules; [ + flake.diskoConfigurations.standard + desktop-usage + wifi + ]; + + boot.loader.systemd-boot.enable = true; +} diff --git a/nixos/base/default.nix b/nixos/base/default.nix deleted file mode 100644 index 6d70d4c..0000000 --- a/nixos/base/default.nix +++ /dev/null @@ -1,60 +0,0 @@ -{ - # flake, - inputs, - outputs, - lib, - config, - modulesPath, - ... -}: { - imports = - [ - (modulesPath + "/installer/scan/not-detected.nix") - inputs.disko.nixosModules.disko - # flake.diskoConfigurations.standard - ] - ++ ( - with outputs.nixosModules; [ - desktop-usage - wifi - ] - ) - ++ (with outputs.homeManagerModules; [ - sway - ]); - - nixpkgs = { - overlays = [ - outputs.overlays.additions - outputs.overlays.modifications - outputs.overlays.unstable-packages - ]; - config = { - allowUnfree = true; - }; - }; - - nix = { - registry = lib.mapAttrs (_: value: {flake = value;}) inputs; - nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry; - - settings = { - experimental-features = "nix-command flakes"; - auto-optimise-store = true; - }; - }; - - # not necessarily "base", but all my machines are UEFI so... - # boot.loader.systemd-boot.enable = true; - - networking = { - firewall = { - enable = true; - allowPing = true; - allowedTCPPorts = [22]; - allowedUDPPorts = []; - }; - }; - - system.stateVersion = "23.11"; -} diff --git a/nixos/beefcake/default.nix b/nixos/beefcake.nix similarity index 100% rename from nixos/beefcake/default.nix rename to nixos/beefcake.nix diff --git a/nixos/default.nix b/nixos/default.nix index e49ffa8..3ae4b0a 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -1,41 +1,16 @@ -{ - base = { - system = "x86_64-linux"; - modules = [./base]; - }; - - thablet = { - system = "x86_64-linux"; - modules = [./thablet]; - }; - - thinker = { - system = "x86_64-linux"; - modules = [./thinker]; - }; - - foxtrot = { - system = "x86_64-linux"; - modules = [./foxtrot]; - }; - - beefcake = { - system = "x86_64-linux"; - modules = [./beefcake]; - }; - - rascal = { - system = "x86_64-linux"; - modules = [./rascal]; - }; - - musicbox = { - system = "x86_64-linux"; - modules = [./musicbox]; - }; - - router = { - system = "x86_64-linux"; - modules = [./router]; - }; -} +with builtins; (listToAttrs (map (name: { + name = name; + value = { + system = "x86_64-linux"; + modules = [./${name}.nix]; + }; + }) [ + "base" + "thablet" + "thinker" + "foxtrot" + "beefcake" + "rascal" + "musicbox" + "router" + ])) diff --git a/nixos/dragon.nix b/nixos/dragon.nix new file mode 100644 index 0000000..709cb4b --- /dev/null +++ b/nixos/dragon.nix @@ -0,0 +1,73 @@ +{ + flake, + inputs, + outputs, + lib, + pkgs, + modulesPath, + ... +}: { + networking.hostName = "dragon"; + + # support interacting with the windows drive + boot.supportedFilesystems = ["ntfs"]; + + imports = + [ + (modulesPath + "/installer/scan/not-detected.nix") + inputs.disko.nixosModules.disko + flake.diskoConfigurations.standard + inputs.hardware.nixosModules.common-cpu-amd + inputs.hardware.nixosModules.common-pc-ssd + outputs.nixosModules.pipewire-low-latency + ] + ++ (with outputs.nixosModules; [ + common + melee + desktop-usage + podman + postgres + wifi + hyprland + printing + ewwbar + ]); + + services.printing.enable = true; + + # TODO: https://nixos.wiki/wiki/Remote_LUKS_Unlocking + + # hardware + boot.loader.efi.canTouchEfiVariables = true; + boot.loader.systemd-boot.enable = true; + boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "ahci"]; + boot.kernelModules = ["kvm-amd"]; + + hardware.bluetooth.enable = true; + powerManagement.cpuFreqGovernor = lib.mkDefault "performance"; + + environment = { + systemPackages = with pkgs; [ + radeontop + ]; + }; + + networking = { + firewall = { + enable = true; + allowPing = true; + allowedTCPPorts = [22 7777]; + allowedUDPPorts = []; + }; + }; + + services.udev.packages = [ + pkgs.platformio + pkgs.openocd + ]; + programs.adb.enable = true; + users.users.daniel.extraGroups = ["adbusers"]; + + # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion + system.stateVersion = "23.11"; +} diff --git a/nixos/dragon/default.nix b/nixos/dragon/default.nix deleted file mode 100644 index d59f085..0000000 --- a/nixos/dragon/default.nix +++ /dev/null @@ -1,120 +0,0 @@ -{ - flake, - inputs, - outputs, - lib, - config, - pkgs, - modulesPath, - ... -}: { - networking.hostName = "dragon"; - - boot.supportedFilesystems = ["ntfs"]; - - imports = - [ - (modulesPath + "/installer/scan/not-detected.nix") - inputs.disko.nixosModules.disko - flake.diskoConfigurations.standard - inputs.hardware.nixosModules.common-cpu-amd - inputs.hardware.nixosModules.common-pc-ssd - outputs.nixosModules.pipewire-low-latency - ] - ++ (with outputs.nixosModules; [ - melee - desktop-usage - podman - postgres - wifi - hyprland - ewwbar - ]) - ++ [ - # Or modules from other flakes (such as nixos-hardware): - # inputs.hardware.nixosModules.common-cpu-amd - # inputs.hardware.nixosModules.common-ssd - - # You can also split up your configuration and import pieces of it here: - # ./users.nix - ]; - - # TODO: https://nixos.wiki/wiki/Remote_LUKS_Unlocking - - nixpkgs = { - # You can add overlays here - overlays = [ - # Add overlays your own flake exports (from overlays and pkgs dir): - outputs.overlays.additions - outputs.overlays.modifications - outputs.overlays.unstable-packages - - # You can also add overlays exported from other flakes: - # neovim-nightly-overlay.overlays.default - - # Or define it inline, for example: - # (final: prev: { - # hi = final.hello.overrideAttrs (oldAttrs: { - # patches = [ ./change-hello-to-hi.patch ]; - # }); - # }) - ]; - # Configure your nixpkgs instance - config = { - # Disable if you don't want unfree packages - allowUnfree = true; - }; - }; - - nix = { - # This will add each flake input as a registry - # To make nix3 commands consistent with your flake - registry = lib.mapAttrs (_: value: {flake = value;}) inputs; - - # This will additionally add your inputs to the system's legacy channels - # Making legacy nix commands consistent as well, awesome! - nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry; - - settings = { - # Enable flakes and new 'nix' command - experimental-features = "nix-command flakes"; - # Deduplicate and optimize nix store - auto-optimise-store = true; - }; - }; - - # hardware - boot.loader.efi.canTouchEfiVariables = true; - boot.loader.systemd-boot.enable = true; - boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "ahci"]; - boot.kernelModules = ["kvm-amd"]; - - hardware.bluetooth.enable = true; - powerManagement.cpuFreqGovernor = lib.mkDefault "performance"; - services.printing.enable = true; - - environment = { - systemPackages = with pkgs; [ - radeontop - ]; - }; - - networking = { - firewall = { - enable = true; - allowPing = true; - allowedTCPPorts = [22 7777]; - allowedUDPPorts = []; - }; - }; - - services.udev.packages = [ - pkgs.platformio - pkgs.openocd - ]; - programs.adb.enable = true; - users.users.daniel.extraGroups = ["adbusers"]; - - # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion - system.stateVersion = "23.11"; -} diff --git a/nixos/foxtrot/default.nix b/nixos/foxtrot.nix similarity index 92% rename from nixos/foxtrot/default.nix rename to nixos/foxtrot.nix index 28f5012..8e09504 100644 --- a/nixos/foxtrot/default.nix +++ b/nixos/foxtrot.nix @@ -135,23 +135,6 @@ powerOnBoot = false; }; powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand"; - services.printing.enable = true; - services.printing.browsing = true; - services.printing.browsedConf = '' - BrowseDNSSDSubTypes _cups,_print - BrowseLocalProtocols all - BrowseRemoteProtocols all - CreateIPPPrinterQueues All - - BrowseProtocols all - ''; - services.printing.drivers = [pkgs.gutenprint]; - services.avahi = { - enable = true; - reflector = true; - openFirewall = true; - nssmdns = true; - }; services.fprintd = { enable = false; diff --git a/nixos/musicbox/default.nix b/nixos/musicbox.nix similarity index 100% rename from nixos/musicbox/default.nix rename to nixos/musicbox.nix diff --git a/nixos/rascal/default.nix b/nixos/rascal.nix similarity index 100% rename from nixos/rascal/default.nix rename to nixos/rascal.nix diff --git a/nixos/router/default.nix b/nixos/router.nix similarity index 100% rename from nixos/router/default.nix rename to nixos/router.nix diff --git a/nixos/thablet/default.nix b/nixos/thablet.nix similarity index 95% rename from nixos/thablet/default.nix rename to nixos/thablet.nix index ace98a3..8607d27 100644 --- a/nixos/thablet/default.nix +++ b/nixos/thablet.nix @@ -10,7 +10,6 @@ imports = [ (modulesPath + "/installer/scan/not-detected.nix") - inputs.disko.nixosModules.disko flake.diskoConfigurations.standard inputs.hardware.nixosModules.lenovo-thinkpad-x1-yoga ] @@ -43,7 +42,6 @@ }; }; - # not necessarily "base", but all my machines are UEFI so... boot.loader.systemd-boot.enable = true; services.fprintd = { diff --git a/nixos/thinker/default.nix b/nixos/thinker.nix similarity index 100% rename from nixos/thinker/default.nix rename to nixos/thinker.nix