Compare commits
No commits in common. "02f530c6b9756d4cc6af044f03c2d67e7779a886" and "b8cd94925e62e915ed9ffc52a2bd26d1412181b5" have entirely different histories.
02f530c6b9
...
b8cd94925e
15 changed files with 169 additions and 567 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1,4 +1,2 @@
|
||||||
result
|
result
|
||||||
result-*
|
result-*
|
||||||
localnotes.md
|
|
||||||
*.qcow2
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
This repository manages **multiple NixOS systems** using a shared modular configuration.
|
This repository maanges **multiple NixOS systems** using a shared modular configuration.
|
||||||
It's designed to be **secure, composable, and automated** using modern Nix tooling.
|
It's designed to be **secure, composable, and automated** using modern Nix tooling.
|
||||||
|
|
||||||
- **Laptop ("neon")**: Portable KVM/Swiss-Army Knife
|
- **Laptop ("neon")**: Portable KVM/Swiss-Army Knife
|
||||||
|
|
|
||||||
120
flake.lock
generated
120
flake.lock
generated
|
|
@ -135,22 +135,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-compat_2": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1751685974,
|
|
||||||
"narHash": "sha256-NKw96t+BgHIYzHUjkTK95FqYRVKB8DHpVhefWSz/kTw=",
|
|
||||||
"ref": "refs/heads/main",
|
|
||||||
"rev": "549f2762aebeff29a2e5ece7a7dc0f955281a1d1",
|
|
||||||
"revCount": 92,
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://git.lix.systems/lix-project/flake-compat.git"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://git.lix.systems/lix-project/flake-compat.git"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-parts": {
|
"flake-parts": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs-lib": [
|
"nixpkgs-lib": [
|
||||||
|
|
@ -173,27 +157,6 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-parts_2": {
|
"flake-parts_2": {
|
||||||
"inputs": {
|
|
||||||
"nixpkgs-lib": [
|
|
||||||
"nvf",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1760948891,
|
|
||||||
"narHash": "sha256-TmWcdiUUaWk8J4lpjzu4gCGxWY6/Ok7mOK4fIFfBuU4=",
|
|
||||||
"owner": "hercules-ci",
|
|
||||||
"repo": "flake-parts",
|
|
||||||
"rev": "864599284fc7c0ba6357ed89ed5e2cd5040f0c04",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "hercules-ci",
|
|
||||||
"repo": "flake-parts",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-parts_3": {
|
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs-lib": [
|
"nixpkgs-lib": [
|
||||||
"stylix",
|
"stylix",
|
||||||
|
|
@ -276,11 +239,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1762964643,
|
"lastModified": 1762787259,
|
||||||
"narHash": "sha256-RYHN8O/Aja59XDji6WSJZPkJpYVUfpSkyH+PEupBJqM=",
|
"narHash": "sha256-t2U/GLLXHa2+kJkwnFNRVc2fEJ/lUfyZXBE5iKzJdcs=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "827f2a23373a774a8805f84ca5344654c31f354b",
|
"rev": "37a3d97f2873e0f68711117c34d04b7c7ead8f4e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -315,28 +278,13 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mnw": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1758834834,
|
|
||||||
"narHash": "sha256-Y7IvY4F8vajZyp3WGf+KaiIVwondEkMFkt92Cr9NZmg=",
|
|
||||||
"owner": "Gerg-L",
|
|
||||||
"repo": "mnw",
|
|
||||||
"rev": "cfbc7d1cc832e318d0863a5fc91d940a96034001",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "Gerg-L",
|
|
||||||
"repo": "mnw",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixos-hardware": {
|
"nixos-hardware": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1762847253,
|
"lastModified": 1762463231,
|
||||||
"narHash": "sha256-BWWnUUT01lPwCWUvS0p6Px5UOBFeXJ8jR+ZdLX8IbrU=",
|
"narHash": "sha256-hv1mG5j5PTbnWbtHHomzTus77pIxsc4x8VrMjc7+/YE=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixos-hardware",
|
"repo": "nixos-hardware",
|
||||||
"rev": "899dc449bc6428b9ee6b3b8f771ca2b0ef945ab9",
|
"rev": "52113c4f5cfd1e823001310e56d9c8d0699a6226",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -347,11 +295,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1762977756,
|
"lastModified": 1762596750,
|
||||||
"narHash": "sha256-4PqRErxfe+2toFJFgcRKZ0UI9NSIOJa+7RXVtBhy4KE=",
|
"narHash": "sha256-rXXuz51Bq7DHBlfIjN7jO8Bu3du5TV+3DSADBX7/9YQ=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "c5ae371f1a6a7fd27823bc500d9390b38c05fa55",
|
"rev": "b6a8526db03f735b89dd5ff348f53f752e7ddc8e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -386,30 +334,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nvf": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-compat": "flake-compat_2",
|
|
||||||
"flake-parts": "flake-parts_2",
|
|
||||||
"mnw": "mnw",
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
],
|
|
||||||
"systems": "systems"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1762622004,
|
|
||||||
"narHash": "sha256-NpzzgaoMK8aRHnndHWbYNKLcZN0r1y6icCoJvGoBsoE=",
|
|
||||||
"owner": "notashelf",
|
|
||||||
"repo": "nvf",
|
|
||||||
"rev": "09470524a214ed26633ddc2b6ec0c9bf31a8b909",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "notashelf",
|
|
||||||
"repo": "nvf",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"pre-commit-hooks-nix": {
|
"pre-commit-hooks-nix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": [
|
"flake-compat": [
|
||||||
|
|
@ -443,7 +367,6 @@
|
||||||
"lanzaboote": "lanzaboote",
|
"lanzaboote": "lanzaboote",
|
||||||
"nixos-hardware": "nixos-hardware",
|
"nixos-hardware": "nixos-hardware",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"nvf": "nvf",
|
|
||||||
"sops-nix": "sops-nix",
|
"sops-nix": "sops-nix",
|
||||||
"stylix": "stylix"
|
"stylix": "stylix"
|
||||||
}
|
}
|
||||||
|
|
@ -476,11 +399,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1763069729,
|
"lastModified": 1762659808,
|
||||||
"narHash": "sha256-A91a+K0Q9wfdPLwL06e/kbHeAWSzPYy2EGdTDsyfb+s=",
|
"narHash": "sha256-2Kv2mANf+FRisqhpfeZ8j9firBxb23ZvEXwdcunbpGI=",
|
||||||
"owner": "Mic92",
|
"owner": "Mic92",
|
||||||
"repo": "sops-nix",
|
"repo": "sops-nix",
|
||||||
"rev": "a2bcd1c25c1d29e22756ccae094032ab4ada2268",
|
"rev": "524312bc62e3f34bd9231a2f66622663d3355133",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -496,13 +419,13 @@
|
||||||
"base16-helix": "base16-helix",
|
"base16-helix": "base16-helix",
|
||||||
"base16-vim": "base16-vim",
|
"base16-vim": "base16-vim",
|
||||||
"firefox-gnome-theme": "firefox-gnome-theme",
|
"firefox-gnome-theme": "firefox-gnome-theme",
|
||||||
"flake-parts": "flake-parts_3",
|
"flake-parts": "flake-parts_2",
|
||||||
"gnome-shell": "gnome-shell",
|
"gnome-shell": "gnome-shell",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
],
|
],
|
||||||
"nur": "nur",
|
"nur": "nur",
|
||||||
"systems": "systems_2",
|
"systems": "systems",
|
||||||
"tinted-foot": "tinted-foot",
|
"tinted-foot": "tinted-foot",
|
||||||
"tinted-kitty": "tinted-kitty",
|
"tinted-kitty": "tinted-kitty",
|
||||||
"tinted-schemes": "tinted-schemes",
|
"tinted-schemes": "tinted-schemes",
|
||||||
|
|
@ -538,21 +461,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"systems_2": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1681028828,
|
|
||||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tinted-foot": {
|
"tinted-foot": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
|
|
||||||
75
flake.nix
75
flake.nix
|
|
@ -13,46 +13,13 @@
|
||||||
disko.inputs.nixpkgs.follows = "nixpkgs";
|
disko.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
stylix.url = "github:nix-community/stylix";
|
stylix.url = "github:nix-community/stylix";
|
||||||
stylix.inputs.nixpkgs.follows = "nixpkgs";
|
stylix.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
#obsidian-nvim.url = "github:epwalsh/obsidian.nvim";
|
|
||||||
nvf = {
|
|
||||||
url = "github:notashelf/nvf";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
#inputs.obsidian-nvim.follows = "obsidian-nvim";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
# https://nix.dev/tutorials/nix-language.html#named-attribute-set-argument
|
# https://nix.dev/tutorials/nix-language.html#named-attribute-set-argument
|
||||||
outputs =
|
outputs = inputs@{self, nixpkgs, nixos-hardware, home-manager, sops-nix, lanzaboote, disko, stylix, ...}:
|
||||||
inputs@{
|
|
||||||
self,
|
|
||||||
nixpkgs,
|
|
||||||
nixos-hardware,
|
|
||||||
home-manager,
|
|
||||||
sops-nix,
|
|
||||||
lanzaboote,
|
|
||||||
disko,
|
|
||||||
stylix,
|
|
||||||
nvf,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
let
|
||||||
zwLib = import ./lib {
|
mkSystem = (import ./lib {
|
||||||
inherit nixpkgs home-manager inputs;
|
inherit nixpkgs home-manager inputs;
|
||||||
};
|
}).mkSystem;
|
||||||
mkSystem = zwLib.mkSystem;
|
|
||||||
mkHome = zwLib.mkHome;
|
|
||||||
mkHomeConfigs = zwLib.mkHomeConfigs;
|
|
||||||
|
|
||||||
# NOTE: Currently these are exclusively user-profiles which use home-manager.
|
|
||||||
# Their home-manager specific declarations are at ../users/${username}/home.nix
|
|
||||||
system = "x86_64-linux"; # TODO: Improve this from only static x86 to dynamic.
|
|
||||||
homeUserProfiles = {
|
|
||||||
jml = mkHome {
|
|
||||||
inherit system; # inputs;
|
|
||||||
username = "jml";
|
|
||||||
extraModules = [ nvf.homeManagerModules.default ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
lib = {
|
lib = {
|
||||||
|
|
@ -78,17 +45,25 @@
|
||||||
users = [
|
users = [
|
||||||
"jml"
|
"jml"
|
||||||
];
|
];
|
||||||
homeUsers = {
|
|
||||||
jml = homeUserProfiles.jml.module;
|
|
||||||
};
|
|
||||||
#extraModules = [ (import ./overlays) ];
|
|
||||||
# NOTE: If I'm using a home-manager configuration on a given host,
|
|
||||||
# I also need to include the relevant modules.
|
|
||||||
# TODO: Can I instead self-reference the homeConfigurations in this flake?
|
|
||||||
extraModules = [
|
extraModules = [
|
||||||
stylix.nixosModules.stylix
|
#(import ./overlays)
|
||||||
|
#stylix.nixosModules.stylix
|
||||||
|
{ nixpkgs.config.allowUnfree = true; }
|
||||||
|
lanzaboote.nixosModules.lanzaboote
|
||||||
|
disko.nixosModules.disko
|
||||||
|
./hosts/titanium/disko.nix
|
||||||
|
({ pkgs, lib, ... }: {
|
||||||
|
environment.systemPackages = [ pkgs.sbctl ];
|
||||||
|
boot.loader.systemd-boot.enable = lib.mkForce false;
|
||||||
|
boot.lanzaboote.enable = true;
|
||||||
|
boot.lanzaboote.pkiBundle = "/var/lib/sbctl";
|
||||||
|
})
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
cobalt = mkSystem {
|
||||||
|
hostname = "cobalt";
|
||||||
|
users = [ "jml" ];
|
||||||
|
};
|
||||||
# `nix build .#nixosConfigurations.installIso.config.system.build.isoImage`
|
# `nix build .#nixosConfigurations.installIso.config.system.build.isoImage`
|
||||||
# https://github.com/nix-community/nixos-generators
|
# https://github.com/nix-community/nixos-generators
|
||||||
installIso = nixpkgs.lib.nixosSystem {
|
installIso = nixpkgs.lib.nixosSystem {
|
||||||
|
|
@ -99,10 +74,12 @@
|
||||||
specialArgs = {inherit inputs;};
|
specialArgs = {inherit inputs;};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
homeConfigurations = {
|
||||||
# For Debugging: `home-manager build --flake .` or `nix build .#homeConfigurations."jml".activationPackage`
|
"jml" = home-manager.lib.homeManagerConfiguration {
|
||||||
# `home-manager switch --flake .#jml`
|
modules = [
|
||||||
# https://nix-community.github.io/home-manager/options.xhtml
|
./users/jml/home.nix
|
||||||
homeConfigurations = mkHomeConfigs homeUserProfiles;
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
services.kanidm = {
|
services.kanidm = {
|
||||||
package = pkgs.kanidmWithSecretProvisioning_1_7;
|
package = pkgs.kanidmWithSecretProvisioning;
|
||||||
enableServer = true;
|
enableServer = true;
|
||||||
serverSettings = {
|
serverSettings = {
|
||||||
# NOTE: Required to start the server: https://kanidm.github.io/kanidm/stable/server_configuration.html
|
# NOTE: Required to start the server: https://kanidm.github.io/kanidm/stable/server_configuration.html
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
imports = [
|
imports = [
|
||||||
../../modules/nixos/base.nix
|
../../modules/nixos/base.nix
|
||||||
../../modules/nixos/audio.nix
|
../../modules/nixos/audio.nix
|
||||||
../../modules/nixos/desktop
|
../../modules/nixos/desktop.nix
|
||||||
# https://github.com/NixOS/nixos-hardware/blob/master/README.md#using-nix-flakes-support
|
# https://github.com/NixOS/nixos-hardware/blob/master/README.md#using-nix-flakes-support
|
||||||
inputs.nixos-hardware.nixosModules.gpd-pocket-3
|
inputs.nixos-hardware.nixosModules.gpd-pocket-3
|
||||||
# override from nixos-hardware
|
# override from nixos-hardware
|
||||||
|
|
|
||||||
|
|
@ -6,12 +6,9 @@
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
sbctl # Secure-Boot
|
sbctl # Secure-Boot
|
||||||
helix nil # nice for editing '.nix'
|
helix nil # nice for editing '.nix'
|
||||||
(discord.override { withVencord = true; })
|
discord
|
||||||
signal-desktop
|
signal-desktop
|
||||||
obs-studio
|
obs-studio
|
||||||
halloy # IRC
|
|
||||||
gimp3
|
|
||||||
nyxt # browser
|
|
||||||
];
|
];
|
||||||
# Hardware Specific programs...
|
# Hardware Specific programs...
|
||||||
#programs.ryzen-monitor-ng.enable = true;
|
#programs.ryzen-monitor-ng.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,8 @@ let
|
||||||
mupen64plus # Nintendo 64 - Maybe simple64 some day.
|
mupen64plus # Nintendo 64 - Maybe simple64 some day.
|
||||||
dolphin # GameCube
|
dolphin # GameCube
|
||||||
mgba # GameBoy / Color / Advance
|
mgba # GameBoy / Color / Advance
|
||||||
#melonds # Nintendo DS
|
melonds # Nintendo DS
|
||||||
#citra # Nintendo 3DS
|
citra # Nintendo 3DS
|
||||||
|
|
||||||
|
|
||||||
# Sony
|
# Sony
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@
|
||||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sr_mod" ];
|
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sr_mod" ];
|
||||||
boot.initrd.kernelModules = [ ];
|
boot.initrd.kernelModules = [ ];
|
||||||
boot.kernelModules = [ "kvm-amd" ];
|
boot.kernelModules = [ "kvm-amd" ];
|
||||||
# boot.blacklistedKernelModules = [ "nouveau" ];
|
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
fileSystems."/" =
|
fileSystems."/" =
|
||||||
|
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
{ ... }:
|
|
||||||
{
|
|
||||||
programs.zoom-us.enable = true;
|
|
||||||
}
|
|
||||||
|
|
@ -14,12 +14,9 @@
|
||||||
# https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/linux/nvidia-x11/generic.nix#L65
|
# https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/linux/nvidia-x11/generic.nix#L65
|
||||||
nixpkgs.config.nvidia.acceptLicense = true;
|
nixpkgs.config.nvidia.acceptLicense = true;
|
||||||
hardware.nvidia = {
|
hardware.nvidia = {
|
||||||
# TODO: Consider legacy drivers.
|
|
||||||
# https://discourse.nixos.org/t/cant-use-nvidia-offload-mode/27791/8
|
|
||||||
package = config.boot.kernelPackages.nvidiaPackages.latest;
|
package = config.boot.kernelPackages.nvidiaPackages.latest;
|
||||||
modesetting.enable = true;
|
modesetting.enable = true;
|
||||||
# Open Source Drivers: https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
|
open = true;
|
||||||
open = false;
|
|
||||||
nvidiaSettings = true;
|
nvidiaSettings = true;
|
||||||
powerManagement.enable = false;
|
powerManagement.enable = false;
|
||||||
powerManagement.finegrained = false;
|
powerManagement.finegrained = false;
|
||||||
|
|
|
||||||
109
lib/default.nix
109
lib/default.nix
|
|
@ -1,27 +1,19 @@
|
||||||
{
|
{ nixpkgs, home-manager, inputs, ... }:
|
||||||
nixpkgs,
|
|
||||||
home-manager,
|
|
||||||
inputs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
let
|
||||||
allOverlays = import (../overlays) { inherit nixpkgs; };
|
allOverlays = import (../overlays) { inherit nixpkgs; };
|
||||||
getPkgs =
|
|
||||||
system:
|
|
||||||
import nixpkgs {
|
|
||||||
inherit system;
|
|
||||||
overlays = allOverlays;
|
|
||||||
};
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
mkSystem =
|
# It's not really that I care about whether a system is a desktop system or
|
||||||
{
|
# a server system, but moreso that I care about whether a system is headless or not.
|
||||||
|
# I also care about things like if it's darwin, or wsl.
|
||||||
|
# TODO: Expand this to actually make use of extraSpecialArgs and pass special
|
||||||
|
# args to the relevant places.
|
||||||
|
mkSystem = {
|
||||||
hostname,
|
hostname,
|
||||||
system ? "x86_64-linux",
|
system ? "x86_64-linux",
|
||||||
users ? [],
|
users ? [],
|
||||||
extraModules ? [],
|
extraModules ? [],
|
||||||
homeUsers ? { },
|
extraSpecialArgs ? {}
|
||||||
extraSpecialArgs ? { },
|
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
pkgs_with_overlays = import nixpkgs {
|
pkgs_with_overlays = import nixpkgs {
|
||||||
|
|
@ -32,82 +24,45 @@ in
|
||||||
inherit inputs;
|
inherit inputs;
|
||||||
pkgs = pkgs_with_overlays;
|
pkgs = pkgs_with_overlays;
|
||||||
};
|
};
|
||||||
userModules = map (
|
userModules = map (name:
|
||||||
name:
|
|
||||||
import ../users/${name} {
|
import ../users/${name} {
|
||||||
pkgs = pkgs_with_overlays;
|
pkgs = pkgs_with_overlays;
|
||||||
lib = nixpkgs.lib;
|
lib = nixpkgs.lib;
|
||||||
}
|
}
|
||||||
) users;
|
) users;
|
||||||
|
|
||||||
formattedHomeUsers = nixpkgs.lib.mapAttrs (username: moduleList: {
|
homeUserNames = builtins.filter (name:
|
||||||
imports = moduleList;
|
builtins.pathExists ../users/${name}/home.nix
|
||||||
}) homeUsers;
|
) users;
|
||||||
|
|
||||||
|
homeUsers = nixpkgs.lib.listToAttrs (map (name: {
|
||||||
|
name = name;
|
||||||
|
value = import ../users/${name}/home.nix {
|
||||||
|
username = name;
|
||||||
|
pkgs = pkgs_with_overlays;
|
||||||
|
lib = nixpkgs.lib;
|
||||||
|
};
|
||||||
|
}) homeUserNames);
|
||||||
in
|
in
|
||||||
nixpkgs.lib.nixosSystem {
|
nixpkgs.lib.nixosSystem {
|
||||||
inherit system;
|
inherit system;
|
||||||
modules = [
|
# pkgs = import inputs.nixpkgs {
|
||||||
hostModule
|
# inherit system;
|
||||||
]
|
# overlays = allOverlays;
|
||||||
|
# config = { allowUnfree = true; nvidia.acceptLicense = true; };
|
||||||
|
# };
|
||||||
|
modules = [ hostModule ]
|
||||||
++ userModules
|
++ userModules
|
||||||
++ extraModules
|
++ extraModules
|
||||||
++ (
|
++ (if homeUserNames != [] then [
|
||||||
if homeUsers != { } then
|
|
||||||
[
|
|
||||||
home-manager.nixosModules.home-manager
|
home-manager.nixosModules.home-manager
|
||||||
{
|
{
|
||||||
#home-manager.useGlobalPkgs = true; # NOTE: Incompatible with nixpkgs.{config,overlays}
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
home-manager.backupFileExtension = "hm-bak";
|
home-manager.backupFileExtension = "hm-bak";
|
||||||
|
home-manager.users = homeUsers;
|
||||||
# Directly inject the module lists? (isn't this the problem?)
|
|
||||||
home-manager.users = formattedHomeUsers;
|
|
||||||
home-manager.extraSpecialArgs = { inherit inputs; };
|
|
||||||
}
|
}
|
||||||
]
|
] else []);
|
||||||
else
|
|
||||||
[ ]
|
|
||||||
);
|
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
inherit inputs hostname;
|
inherit inputs hostname;
|
||||||
}
|
} // extraSpecialArgs;
|
||||||
// extraSpecialArgs;
|
};
|
||||||
};
|
|
||||||
|
|
||||||
getUserHomeModule =
|
|
||||||
username: pkgs: inputs:
|
|
||||||
import ../users/${username}/home.nix {
|
|
||||||
inherit username pkgs inputs;
|
|
||||||
lib = nixpkgs.lib;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
This function returns an attribute set { module, config }.
|
|
||||||
*/
|
|
||||||
mkHome =
|
|
||||||
{
|
|
||||||
username,
|
|
||||||
system ? "x86_64-linux",
|
|
||||||
extraModules ? [ ],
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
pkgs_with_overlays = getPkgs system;
|
|
||||||
moduleList = [
|
|
||||||
(import ../users/${username}/home.nix {
|
|
||||||
inherit inputs username;
|
|
||||||
pkgs = pkgs_with_overlays;
|
|
||||||
lib = nixpkgs.lib;
|
|
||||||
})
|
|
||||||
]
|
|
||||||
++ extraModules;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
module = moduleList;
|
|
||||||
config = home-manager.lib.homeManagerConfiguration {
|
|
||||||
pkgs = pkgs_with_overlays;
|
|
||||||
modules = moduleList;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
mkHomeConfigs = userProfiles: nixpkgs.lib.mapAttrs (username: profile: profile.config) userProfiles;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,11 @@
|
||||||
zw.gaming.enable = lib.mkEnableOption "Enable Gaming";
|
zw.gaming.enable = lib.mkEnableOption "Enable Gaming";
|
||||||
};
|
};
|
||||||
|
|
||||||
# https://wiki.nixos.org/wiki/Category:Gaming
|
|
||||||
config = lib.mkIf config.zw.gaming.enable {
|
config = lib.mkIf config.zw.gaming.enable {
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
mangohud
|
mangohud
|
||||||
protonup-qt
|
protonup-qt
|
||||||
lutris # TODO: Having an issue after flake update
|
# lutris # TODO: Having an issue after flake update
|
||||||
bottles
|
bottles
|
||||||
heroic
|
heroic
|
||||||
];
|
];
|
||||||
|
|
@ -21,11 +20,5 @@
|
||||||
protontricks.enable = true;
|
protontricks.enable = true;
|
||||||
gamescopeSession.enable = true;
|
gamescopeSession.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.gamemode.enable = true;
|
|
||||||
programs.gamescope = {
|
|
||||||
enable = true;
|
|
||||||
capSysNice = true;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,6 @@
|
||||||
{ pkgs, lib, ... }:
|
{ pkgs, lib, ... }:
|
||||||
{
|
{
|
||||||
programs.fish.enable = true;
|
programs.fish.enable = true;
|
||||||
environment.systemPackages = [
|
|
||||||
pkgs.home-manager
|
|
||||||
];
|
|
||||||
users.users.jml = {
|
users.users.jml = {
|
||||||
shell = pkgs.fish;
|
shell = pkgs.fish;
|
||||||
home =
|
home =
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,4 @@
|
||||||
{
|
{ username, pkgs, lib, ... }:
|
||||||
username,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
inputs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
{
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
# The following line is needed if I start using hyprland Home Manager Module
|
# The following line is needed if I start using hyprland Home Manager Module
|
||||||
|
|
@ -25,9 +19,7 @@
|
||||||
else
|
else
|
||||||
abort "Unsupported OS";
|
abort "Unsupported OS";
|
||||||
};
|
};
|
||||||
home.packages =
|
home.packages = with pkgs; [ ]
|
||||||
with pkgs;
|
|
||||||
[ ]
|
|
||||||
# linux only
|
# linux only
|
||||||
# TODO: Add a test for linux + desktop environment
|
# TODO: Add a test for linux + desktop environment
|
||||||
++ (lib.optionals pkgs.stdenv.isLinux [
|
++ (lib.optionals pkgs.stdenv.isLinux [
|
||||||
|
|
@ -155,7 +147,6 @@
|
||||||
# TODO: figure out how to get config.programs.<name>.enable style
|
# TODO: figure out how to get config.programs.<name>.enable style
|
||||||
# internal references inside this file.
|
# internal references inside this file.
|
||||||
# There's some quirks with how this is used in lib/default.nix
|
# There's some quirks with how this is used in lib/default.nix
|
||||||
# TODO: Use mergiraf for conflict resolution in jj too.
|
|
||||||
programs.jujutsu = {
|
programs.jujutsu = {
|
||||||
enable = true;
|
enable = true;
|
||||||
#enableFishIntegration = true;
|
#enableFishIntegration = true;
|
||||||
|
|
@ -167,8 +158,6 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO: Configure Mergiraf
|
|
||||||
# https://mergiraf.org/introduction.html
|
|
||||||
programs.git = {
|
programs.git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
|
|
@ -202,7 +191,6 @@
|
||||||
init.defaultBranch = "main";
|
init.defaultBranch = "main";
|
||||||
log.decorate = "full";
|
log.decorate = "full";
|
||||||
log.date = "iso";
|
log.date = "iso";
|
||||||
# NOTE: Initially diff3 was for me, now it's for me and mergiraf automation.
|
|
||||||
merge.conflictStyle = "diff3";
|
merge.conflictStyle = "diff3";
|
||||||
};
|
};
|
||||||
# Cribbed from: https://github.com/gitattributes/gitattributes
|
# Cribbed from: https://github.com/gitattributes/gitattributes
|
||||||
|
|
@ -316,209 +304,6 @@
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO: Implement support for at least
|
|
||||||
# Nix, Python, Rust, Golang
|
|
||||||
# TODO: Sort out why TF, `.nix` files tabs are cooked in neovim rn.
|
|
||||||
# It corrects things on document save, but this line for example started with an 8-long tabstop
|
|
||||||
programs.nvf = {
|
|
||||||
enable = true;
|
|
||||||
# When using the Home-Manager Module for nvf, the settings go into the following attribute set.
|
|
||||||
# https://notashelf.github.io/nvf/index.xhtml#sec-hm-flakes
|
|
||||||
settings.vim = {
|
|
||||||
viAlias = true;
|
|
||||||
vimAlias = true;
|
|
||||||
|
|
||||||
# TODO: For some reason spellcheck is having a very difficult time getting
|
|
||||||
# a wordlist.
|
|
||||||
#spellcheck = {
|
|
||||||
# enable = true;
|
|
||||||
# programmingWordlist.enable = true;
|
|
||||||
#};
|
|
||||||
|
|
||||||
lsp = {
|
|
||||||
enable = true;
|
|
||||||
formatOnSave = true;
|
|
||||||
lspkind.enable = false;
|
|
||||||
lightbulb.enable = true;
|
|
||||||
lspsaga.enable = false;
|
|
||||||
trouble.enable = true;
|
|
||||||
lspSignature.enable = false;
|
|
||||||
otter-nvim.enable = true;
|
|
||||||
nvim-docs-view.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
languages = {
|
|
||||||
enableDAP = true;
|
|
||||||
enableExtraDiagnostics = true;
|
|
||||||
enableFormat = true;
|
|
||||||
enableTreesitter = true;
|
|
||||||
|
|
||||||
nix = {
|
|
||||||
enable = true;
|
|
||||||
lsp.enable = true;
|
|
||||||
lsp.server = "nixd";
|
|
||||||
extraDiagnostics.enable = true;
|
|
||||||
format.enable = true;
|
|
||||||
format.type = "nixfmt";
|
|
||||||
treesitter.enable = true;
|
|
||||||
};
|
|
||||||
markdown.enable = true;
|
|
||||||
typst.enable = true;
|
|
||||||
|
|
||||||
assembly.enable = true;
|
|
||||||
bash.enable = true;
|
|
||||||
clang.enable = true;
|
|
||||||
|
|
||||||
python.enable = true;
|
|
||||||
rust = {
|
|
||||||
enable = true;
|
|
||||||
# TODO: null_ls is now deprecated.
|
|
||||||
# https://github.com/NotAShelf/nvf/issues/1175
|
|
||||||
# https://github.com/NotAShelf/nvf/blob/main/.github/CONTRIBUTING.md
|
|
||||||
crates.enable = true;
|
|
||||||
};
|
|
||||||
go.enable = true;
|
|
||||||
zig.enable = true;
|
|
||||||
|
|
||||||
ts.enable = true;
|
|
||||||
html.enable = true;
|
|
||||||
css.enable = true;
|
|
||||||
sql.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
visuals = {
|
|
||||||
nvim-scrollbar.enable = true; # Configurable Visual Scrollbar (Can pair with Cursor, ALE, Diagnostics, Gitsigns, and hlslens)
|
|
||||||
nvim-web-devicons.enable = true; # Nerdfont Icons for use by other plugins
|
|
||||||
nvim-cursorline.enable = true; # Highlight Words & Lines on the cursor
|
|
||||||
cinnamon-nvim.enable = true; # Smooth Scrolling for any movement command.
|
|
||||||
fidget-nvim.enable = true; # UI for Notifications & LSP Progress Messages
|
|
||||||
|
|
||||||
highlight-undo.enable = true; # Highlight changed text after any non-insert actions
|
|
||||||
indent-blankline.enable = true; # Indentation Guides
|
|
||||||
};
|
|
||||||
|
|
||||||
statusline = {
|
|
||||||
lualine = {
|
|
||||||
# Fancy Status Line
|
|
||||||
enable = true;
|
|
||||||
theme = "catppuccin";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
theme = {
|
|
||||||
enable = true;
|
|
||||||
name = "catppuccin";
|
|
||||||
style = "mocha";
|
|
||||||
transparent = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
autopairs.nvim-autopairs.enable = true; # Pair up ", {, (, etc.
|
|
||||||
# blink-cmp is a compiled rust binary while nvim-cmp is a pure lua plugin...
|
|
||||||
autocomplete.blink-cmp.enable = true;
|
|
||||||
# Code Snippets Engine /w support for Lua, VSCode, and SnipMate snippets.
|
|
||||||
snippets.luasnip.enable = true;
|
|
||||||
|
|
||||||
filetree.neo-tree.enable = true; # Filesystem tree sidebar...
|
|
||||||
tabline.nvimBufferline.enable = true; # Shows buffers as tabs at the top.
|
|
||||||
treesitter.context.enable = true;
|
|
||||||
binds = {
|
|
||||||
whichKey.enable = true; # Shows your available keybindings in a popup
|
|
||||||
cheatsheet.enable = true; # Searchable in-editor cheatsheet that uses Telescope
|
|
||||||
};
|
|
||||||
telescope.enable = true; # Fuzzy Finder, central to many other plugins.
|
|
||||||
|
|
||||||
git = {
|
|
||||||
enable = true;
|
|
||||||
gitsigns.enable = true; # Git Info in Buffers + Gutters
|
|
||||||
gitsigns.codeActions.enable = false;
|
|
||||||
neogit.enable = true; # Interactive Git
|
|
||||||
};
|
|
||||||
|
|
||||||
# TODO: Consider switching to `minimap-nvim` for rust-based minimap.
|
|
||||||
# codewindow may be tightly integrated with treesitter though...
|
|
||||||
minimap.codewindow.enable = true;
|
|
||||||
dashboard.alpha.enable = true; # Greeter
|
|
||||||
notify.nvim-notify.enable = true; # Fancy Configurable Notification Manager
|
|
||||||
projects.project-nvim.enable = true;
|
|
||||||
|
|
||||||
utility = {
|
|
||||||
ccc.enable = true; # Color Picker
|
|
||||||
diffview-nvim.enable = true;
|
|
||||||
icon-picker.enable = true;
|
|
||||||
surround.enable = true; # Change Surrounding Delimiter pairs `ysiw)`
|
|
||||||
leetcode-nvim.enable = true; # Allow solving LeetCode problems directly inside neovim
|
|
||||||
multicursors.enable = true; # Edit with multiple cursors simultaneously
|
|
||||||
smart-splits.enable = true; # Split-Pane Management
|
|
||||||
undotree.enable = true; # Undo history visualizer
|
|
||||||
nvim-biscuits.enable = true; # Shows the start of a code block from the bottom
|
|
||||||
|
|
||||||
motion = {
|
|
||||||
# NOTE: https://github.com/smoka7/hop.nvim
|
|
||||||
hop.enable = true; # EasyMotion like, allowing you to jump anywhere in the document with as few keystrokes as possible
|
|
||||||
leap.enable = true; # Jump to anywhere visible
|
|
||||||
# TODO: I sort of hate how precognition injects itself in virtual
|
|
||||||
# lines, but I do like that it can be used to give a reminder.
|
|
||||||
precognition.enable = false; # Helps with discovering motions to navigate your current buffer
|
|
||||||
};
|
|
||||||
images.img-clip.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# TODO: Get Obsidian Working.
|
|
||||||
notes = {
|
|
||||||
# obsidian.enable = true; # neovim fails to build with this enabled.
|
|
||||||
mind-nvim.enable = true;
|
|
||||||
todo-comments.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
terminal = {
|
|
||||||
toggleterm = {
|
|
||||||
enable = true;
|
|
||||||
lazygit.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
ui = {
|
|
||||||
borders.enable = true;
|
|
||||||
noice.enable = true;
|
|
||||||
colorizer.enable = true;
|
|
||||||
modes-nvim.enable = false; # this looks terrible with catppuccin
|
|
||||||
illuminate.enable = true;
|
|
||||||
breadcrumbs = {
|
|
||||||
enable = true;
|
|
||||||
navbuddy.enable = true;
|
|
||||||
};
|
|
||||||
smartcolumn = {
|
|
||||||
enable = true;
|
|
||||||
setupOpts.custom_colorcolumn = {
|
|
||||||
nix = "110";
|
|
||||||
ruby = "120";
|
|
||||||
java = "130";
|
|
||||||
go = [
|
|
||||||
"90"
|
|
||||||
"130"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
fastaction.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
assistant = {
|
|
||||||
chatgpt.enable = false;
|
|
||||||
copilot = {
|
|
||||||
enable = false;
|
|
||||||
cmp.enable = true;
|
|
||||||
};
|
|
||||||
codecompanion-nvim.enable = false;
|
|
||||||
# avante-nvim.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
session.nvim-session-manager.enable = true; # Save sessions to reopen later
|
|
||||||
gestures.gesture-nvim.enable = false; # mouse gesture support?
|
|
||||||
comments.comment-nvim.enable = true; # Fancy commenting
|
|
||||||
presence.neocord.enable = true; # Discord Rich Presence
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.vscode = {
|
programs.vscode = {
|
||||||
enable = true;
|
enable = true;
|
||||||
mutableExtensionsDir = true; # mutually exclusive to programs.vscode.profiles
|
mutableExtensionsDir = true; # mutually exclusive to programs.vscode.profiles
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue