WIP kill special args

This commit is contained in:
Daniel Flanagan 2024-02-16 14:58:33 -06:00
parent 3135d7b4ab
commit 91af8a8b01
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4
10 changed files with 86 additions and 111 deletions

View file

@ -38,8 +38,12 @@
nixpkgs, nixpkgs,
home-manager, home-manager,
... ...
} @ inputs: let }: let
inherit (self) outputs; inherit (self) outputs inputs;
# a wrapper around all the stuff we might hand off to modules so they can
# effectively reference this flake's inputs and outputs
thisFlake = {inherit outputs inputs;};
systems = [ systems = [
"aarch64-linux" "aarch64-linux"
@ -60,22 +64,26 @@
# Your custom packages # Your custom packages
# Acessible through 'nix build', 'nix shell', etc # Acessible through 'nix build', 'nix shell', etc
packages = forAllSystems (system: import ./pkgs {pkgs = nixpkgs.legacyPackages.${system};}); packages = forAllSystems (system:
import ./pkgs {
inherit thisFlake;
pkgs = nixpkgs.legacyPackages.${system};
});
# Formatter for your nix files, available through 'nix fmt' # Formatter for your nix files, available through 'nix fmt'
# Other options beside 'alejandra' include 'nixpkgs-fmt' # Other options beside 'alejandra' include 'nixpkgs-fmt'
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra); formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
# Your custom packages and modifications, exported as overlays # Your custom packages and modifications, exported as overlays
overlays = import ./overlays {inherit inputs;}; overlays = import ./overlays thisFlake;
# Reusable nixos modules you might want to export # Reusable nixos modules you might want to export
# These are usually stuff you would upstream into nixpkgs # These are usually stuff you would upstream into nixpkgs
nixosModules = import ./modules/nixos; nixosModules = import ./modules/nixos thisFlake;
# Reusable home-manager modules you might want to export # Reusable home-manager modules you might want to export
# These are usually stuff you would upstream into home-manager # These are usually stuff you would upstream into home-manager
homeManagerModules = import ./modules/home-manager; homeManagerModules = import ./modules/home-manager thisFlake;
# NixOS configuration entrypoint # NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname' # Available through 'nixos-rebuild --flake .#your-hostname'
@ -86,16 +94,12 @@
}: }:
nixpkgs.lib.nixosSystem { nixpkgs.lib.nixosSystem {
inherit system; inherit system;
specialArgs = {
inherit inputs outputs system;
flake = self;
};
modules = modules =
[ [
self.nixosModules.common outputs.nixosModules.common
] ]
++ modules; ++ modules;
}) (import ./nixos); }) (import ./nixos thisFlake);
# Standalone home-manager configuration entrypoint # Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#your-username@your-hostname' # Available through 'home-manager --flake .#your-username@your-hostname'
@ -106,18 +110,14 @@
in in
home-manager.lib.homeManagerConfiguration { home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
extraSpecialArgs = {
inherit inputs outputs system;
inherit (outputs) colors font;
};
modules = with outputs.homeManagerModules; [ modules = with outputs.homeManagerModules; [
common common
linux
{ {
home.homeDirectory = "/home/deck"; home.homeDirectory = "/home/deck";
home.username = "deck"; home.username = "deck";
home.stateVersion = "24.05"; home.stateVersion = "24.05";
} }
linux
]; ];
}; };
workm1 = let workm1 = let
@ -125,18 +125,14 @@
in in
home-manager.lib.homeManagerConfiguration { home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
extraSpecialArgs = {
inherit inputs outputs system;
inherit (outputs) colors font;
};
modules = with outputs.homeManagerModules; [ modules = with outputs.homeManagerModules; [
common common
macos
{ {
home.homeDirectory = "/Users/daniel.flanagan"; home.homeDirectory = "/Users/daniel.flanagan";
home.username = "daniel.flanagan"; home.username = "daniel.flanagan";
home.stateVersion = "24.05"; home.stateVersion = "24.05";
} }
macos
]; ];
}; };
}; };

View file

@ -1,3 +1,4 @@
_thisFlake:
with builtins; with builtins;
listToAttrs (map (name: { listToAttrs (map (name: {
name = name; name = name;

View file

@ -1,26 +1,23 @@
{ {
config, # config,
lib, # inputs,
inputs, # outputs,
outputs,
system,
pkgs, pkgs,
modulesPath, # modulesPath,
... ...
}: { }: let
lib = pkgs.lib;
in {
networking.hostName = lib.mkDefault "nixoslyte"; networking.hostName = lib.mkDefault "nixoslyte";
imports = imports = [
[ # (modulesPath + "/installer/scan/not-detected.nix")
(modulesPath + "/installer/scan/not-detected.nix") # inputs.sops-nix.nixosModules.sops
inputs.sops-nix.nixosModules.sops # inputs.disko.nixosModules.disko
inputs.disko.nixosModules.disko # inputs.home-manager.nixosModules.home-manager
inputs.home-manager.nixosModules.home-manager # ./avahi.nix
] # ./daniel.nix
++ (with outputs.nixosModules; [ ];
avahi
daniel
]);
hardware.enableRedistributableFirmware = true; hardware.enableRedistributableFirmware = true;
@ -108,7 +105,7 @@
}; };
root = { root = {
openssh.authorizedKeys.keys = config.users.users.daniel.openssh.authorizedKeys.keys; # openssh.authorizedKeys.keys = config.users.users.daniel.openssh.authorizedKeys.keys;
}; };
}; };
@ -157,24 +154,24 @@
useXkbConfig = true; useXkbConfig = true;
earlySetup = true; earlySetup = true;
colors = with outputs.colors; [ # colors = with outputs.colors; [
bg # bg
red # red
green # green
orange # orange
blue # blue
purple # purple
yellow # yellow
fg3 # fg3
fgdim # fgdim
red # red
green # green
orange # orange
blue # blue
purple # purple
yellow # yellow
fg # fg
]; # ];
}; };
networking = { networking = {
@ -239,9 +236,9 @@
# You can add overlays here # You can add overlays here
overlays = [ overlays = [
# Add overlays your own flake exports (from overlays and pkgs dir): # Add overlays your own flake exports (from overlays and pkgs dir):
outputs.overlays.additions # outputs.overlays.additions
outputs.overlays.modifications # outputs.overlays.modifications
outputs.overlays.unstable-packages # outputs.overlays.unstable-packages
# You can also add overlays exported from other flakes: # You can also add overlays exported from other flakes:
# neovim-nightly-overlay.overlays.default # neovim-nightly-overlay.overlays.default
@ -263,11 +260,11 @@
nix = { nix = {
# This will add each flake input as a registry # This will add each flake input as a registry
# To make nix3 commands consistent with your flake # To make nix3 commands consistent with your flake
registry = lib.mapAttrs (_: value: {flake = value;}) inputs; # registry = lib.mapAttrs (_: value: {flake = value;}) inputs;
# This will additionally add your inputs to the system's legacy channels # This will additionally add your inputs to the system's legacy channels
# Making legacy nix commands consistent as well, awesome! # Making legacy nix commands consistent as well, awesome!
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry; # nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
settings = { settings = {
trusted-users = ["root" "daniel"]; trusted-users = ["root" "daniel"];

View file

@ -1,15 +1,5 @@
{ {
pkgs,
inputs,
system,
outputs,
...
}: {
home-manager = { home-manager = {
extraSpecialArgs = {
inherit inputs outputs system;
inherit (outputs) colors font;
};
users.daniel = { users.daniel = {
accounts.email.accounts = { accounts.email.accounts = {
primary = { primary = {
@ -34,12 +24,12 @@
homeDirectory = "/home/daniel/.home"; homeDirectory = "/home/daniel/.home";
}; };
imports = with outputs.homeManagerModules; [ imports = [
common ./common.nix
gnome ./gnome.nix
senpai ./senpai.nix
iex ./iex.nix
cargo ./cargo.nix
]; ];
}; };
}; };

View file

@ -1,3 +1,4 @@
_thisFlake:
with builtins; with builtins;
listToAttrs (map (name: { listToAttrs (map (name: {
name = name; name = name;

View file

@ -1,10 +1,4 @@
{ {
pkgs,
inputs,
outputs,
system,
...
}: {
imports = [ imports = [
./sway.nix ./sway.nix
# ./hyprland.nix # ./hyprland.nix
@ -15,8 +9,6 @@
./kde-connect.nix ./kde-connect.nix
]; ];
nixpkgs.overlays = [outputs.overlays.modifications];
hardware = { hardware = {
opengl = { opengl = {
enable = true; enable = true;

View file

@ -1,14 +1,10 @@
{ {outputs, ...}: {
outputs,
flake,
...
}: {
# a minimal, familiar setup that I can bootstrap atop # a minimal, familiar setup that I can bootstrap atop
imports = with outputs.nixosModules; [ imports = with outputs.nixosModules; [
# may need to be tweaked based on the machine's paritioning scheme # may need to be tweaked based on the machine's paritioning scheme
flake.diskoConfigurations.standard # outputs.diskoConfigurations.standard
desktop-usage # desktop-usage
wifi # wifi
]; ];
# TODO: may not work for non-UEFI? # TODO: may not work for non-UEFI?

View file

@ -1,7 +1,9 @@
thisFlake:
with builtins; (listToAttrs (map (name: { with builtins; (listToAttrs (map (name: {
name = name; name = name;
value = { value = {
system = "x86_64-linux"; system = "x86_64-linux";
# specialArgs = thisFlake;
modules = [./${name}.nix]; modules = [./${name}.nix];
}; };
}) [ }) [

View file

@ -17,14 +17,14 @@
inputs.hardware.nixosModules.common-pc-ssd inputs.hardware.nixosModules.common-pc-ssd
outputs.nixosModules.pipewire-low-latency outputs.nixosModules.pipewire-low-latency
desktop-usage # desktop-usage
podman # podman
postgres # postgres
wifi # wifi
hyprland # hyprland
printing # printing
ewwbar # ewwbar
melee # melee
]; ];
programs.steam.enable = true; programs.steam.enable = true;
@ -32,12 +32,12 @@
home-manager.users.daniel = { home-manager.users.daniel = {
imports = with outputs.homeManagerModules; [ imports = with outputs.homeManagerModules; [
sway # sway
pass # pass
firefox-no-tabs # firefox-no-tabs
melee # melee
# sway-laptop # # sway-laptop
hyprland # hyprland
]; ];
ssbm = { ssbm = {

View file

@ -85,7 +85,7 @@
powerManagement.enable = false; powerManagement.enable = false;
boot.loader.grub.enable = true; # boot.loader.grub.enable = true;
boot.loader.grub.device = "/dev/sda"; boot.loader.grub.device = "/dev/sda";
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"]; boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"];