Compare commits

...

10 commits

24 changed files with 236 additions and 339 deletions

View file

@ -8,20 +8,29 @@ My NixOS configurations, using flakes.
- Text editor: [neovim](https://github.com/neovim/neovim) - Text editor: [neovim](https://github.com/neovim/neovim)
- Shell: [fish](https://github.com/fish-shell/fish-shell) - Shell: [fish](https://github.com/fish-shell/fish-shell)
- Colors: [Catppuccin](https://github.com/catppuccin/catppuccin) - Colors: [Catppuccin](https://github.com/catppuccin/catppuccin)
- Font: [Intel One Mono](github.com/intel/intel-one-mono) - Font: [Intel One Mono](https://github.com/intel/intel-one-mono)
Additionally using a lot of other software you can find in the configuration files. Additionally using a lot of other software you can find in the configuration files.
# 🛠️ Structure # 🛠️ Structure
| Name | Description | | Name | Description |
| ------------------- | ------------------------------------------------- | | ------------------- | -------------------------- |
| [home](home/) | Home manager configuration | | [home](home/) | Home manager configuration |
| [hosts](hosts/) | Host-specific (entry-points of the configuration) | | [hosts](hosts/) | Host-specific |
| [lib](lib/) | Helper functions | | [lib](lib/) | Helper functions |
| [modules](modules/) | NixOS modules | | [modules](modules/) | NixOS modules |
| [system](system/) | NixOS configuration | | [system](system/) | NixOS configuration |
My configuration is structured based on the following principles:
1. Hosts should be the main entry points and outputs.
2. Abstractions should be avoided as much as possible.
The bulk of the configuration can be found either in [home](home/) or [system](system/), which declares most of my programs, with some extra Nix code in [lib](lib/) and custom [modules](modules/), mostly for convenience and to provide a way to globally set styles and themes for now.
My hosts can then pick and choose the programs and configurations that they need from the other directories. If the need arises for a more modular setup for a specific piece of software (ie. having different flavors of Firefox per host), I will write a custom module for it. This helps to avoid unnecessarily abstracting my configuration, as I don't find it necessary for the most part, and I would also like it to remain as simple as possible.
# 👥 Credits # 👥 Credits
People / repositories I have copied / learned from: People / repositories I have copied / learned from:
@ -29,4 +38,4 @@ People / repositories I have copied / learned from:
- [fufexan/dotfiles](https://github.com/fufexan/dotfiles) for the configuration structure - [fufexan/dotfiles](https://github.com/fufexan/dotfiles) for the configuration structure
- [jacekpoz/nixos](https://git.jacekpoz.pl/poz/niksos) for learning how NixOS modules work - [jacekpoz/nixos](https://git.jacekpoz.pl/poz/niksos) for learning how NixOS modules work
Some bits have also been borrowed from within the configuration, and credit has been given when its due. Some bits have also been borrowed from within the configuration, and credit has been given where its due.

View file

@ -39,28 +39,6 @@
"type": "github" "type": "github"
} }
}, },
"chaotic": {
"inputs": {
"flake-schemas": "flake-schemas",
"home-manager": "home-manager",
"jovian": "jovian",
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1729510449,
"narHash": "sha256-/EwjBMYBZ3/2ROT+4M/6tLomgJEgZBpKosWhqtYZkDI=",
"owner": "chaotic-cx",
"repo": "nyx",
"rev": "4e03e8d762623ca925c604800aa18f109cd3bd97",
"type": "github"
},
"original": {
"owner": "chaotic-cx",
"ref": "nyxpkgs-unstable",
"repo": "nyx",
"type": "github"
}
},
"crane": { "crane": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -156,26 +134,6 @@
} }
}, },
"flake-parts_2": { "flake-parts_2": {
"inputs": {
"nixpkgs-lib": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1727826117,
"narHash": "sha256-K5ZLCyfO/Zj9mPFldf3iwS6oZStJcU4tSpiXTMYaaL0=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "3d04084d54bedc3d6b8b736c70ef449225c361b1",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_3": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
"lanzaboote", "lanzaboote",
@ -196,7 +154,7 @@
"type": "github" "type": "github"
} }
}, },
"flake-parts_4": { "flake-parts_3": {
"inputs": { "inputs": {
"nixpkgs-lib": "nixpkgs-lib_2" "nixpkgs-lib": "nixpkgs-lib_2"
}, },
@ -214,7 +172,7 @@
"type": "github" "type": "github"
} }
}, },
"flake-parts_5": { "flake-parts_4": {
"inputs": { "inputs": {
"nixpkgs-lib": "nixpkgs-lib_3" "nixpkgs-lib": "nixpkgs-lib_3"
}, },
@ -232,20 +190,6 @@
"type": "github" "type": "github"
} }
}, },
"flake-schemas": {
"locked": {
"lastModified": 1721999734,
"narHash": "sha256-G5CxYeJVm4lcEtaO87LKzOsVnWeTcHGKbKxNamNWgOw=",
"rev": "0a5c42297d870156d9c57d8f99e476b738dcd982",
"revCount": 75,
"type": "tarball",
"url": "https://api.flakehub.com/f/pinned/DeterminateSystems/flake-schemas/0.1.5/0190ef2f-61e0-794b-ba14-e82f225e55e6/source.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://flakehub.com/f/DeterminateSystems/flake-schemas/%3D0.1.5.tar.gz"
}
},
"flake-utils": { "flake-utils": {
"locked": { "locked": {
"lastModified": 1629284811, "lastModified": 1629284811,
@ -262,26 +206,6 @@
} }
}, },
"flake-utils_2": { "flake-utils_2": {
"inputs": {
"systems": [
"systems"
]
},
"locked": {
"lastModified": 1726560853,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_3": {
"inputs": { "inputs": {
"systems": "systems_2" "systems": "systems_2"
}, },
@ -299,7 +223,7 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_4": { "flake-utils_3": {
"inputs": { "inputs": {
"systems": "systems_3" "systems": "systems_3"
}, },
@ -317,7 +241,7 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_5": { "flake-utils_4": {
"inputs": { "inputs": {
"systems": "systems_6" "systems": "systems_6"
}, },
@ -392,27 +316,6 @@
} }
}, },
"home-manager": { "home-manager": {
"inputs": {
"nixpkgs": [
"chaotic",
"nixpkgs"
]
},
"locked": {
"lastModified": 1729414726,
"narHash": "sha256-Dtmm1OU8Ymiy9hVWn/a2B8DhRYo9Eoyx9veERdOBR4o=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "fe56302339bb28e3471632379d733547caec8103",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"home-manager_2": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
@ -432,34 +335,12 @@
"type": "github" "type": "github"
} }
}, },
"jovian": {
"inputs": {
"nix-github-actions": "nix-github-actions",
"nixpkgs": [
"chaotic",
"nixpkgs"
]
},
"locked": {
"lastModified": 1729177642,
"narHash": "sha256-DdKal+ZhB9QD/tnEwFg4cZ4j4YnrkvSljBxnyG+3eE0=",
"owner": "Jovian-Experiments",
"repo": "Jovian-NixOS",
"rev": "bb69165ff372ddbd3228a03513922acd783040e8",
"type": "github"
},
"original": {
"owner": "Jovian-Experiments",
"repo": "Jovian-NixOS",
"type": "github"
}
},
"lanzaboote": { "lanzaboote": {
"inputs": { "inputs": {
"crane": "crane", "crane": "crane",
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat_2",
"flake-parts": "flake-parts_3", "flake-parts": "flake-parts_2",
"flake-utils": "flake-utils_3", "flake-utils": "flake-utils_2",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
], ],
@ -563,10 +444,10 @@
}, },
"niri": { "niri": {
"inputs": { "inputs": {
"flake-parts": "flake-parts_4", "flake-parts": "flake-parts_3",
"niri-stable": "niri-stable", "niri-stable": "niri-stable",
"niri-unstable": "niri-unstable", "niri-unstable": "niri-unstable",
"nixpkgs": "nixpkgs_4", "nixpkgs": "nixpkgs_3",
"nixpkgs-stable": "nixpkgs-stable_2", "nixpkgs-stable": "nixpkgs-stable_2",
"xwayland-satellite-stable": "xwayland-satellite-stable", "xwayland-satellite-stable": "xwayland-satellite-stable",
"xwayland-satellite-unstable": "xwayland-satellite-unstable" "xwayland-satellite-unstable": "xwayland-satellite-unstable"
@ -618,26 +499,23 @@
"type": "github" "type": "github"
} }
}, },
"nix-github-actions": { "nix-index-db": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"chaotic",
"jovian",
"nixpkgs" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"lastModified": 1690328911, "lastModified": 1729394935,
"narHash": "sha256-fxtExYk+aGf2YbjeWQ8JY9/n9dwuEt+ma1eUFzF8Jeo=", "narHash": "sha256-2ntUG+NJKdfhlrh/tF+jOU0fOesO7lm5ZZVSYitsvH8=",
"owner": "zhaofengli", "owner": "nix-community",
"repo": "nix-github-actions", "repo": "nix-index-database",
"rev": "96df4a39c52f53cb7098b923224d8ce941b64747", "rev": "04f8a11f247ba00263b060fbcdc95484fd046104",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "zhaofengli", "owner": "nix-community",
"ref": "matrix-name", "repo": "nix-index-database",
"repo": "nix-github-actions",
"type": "github" "type": "github"
} }
}, },
@ -789,22 +667,6 @@
} }
}, },
"nixpkgs_5": { "nixpkgs_5": {
"locked": {
"lastModified": 1729256560,
"narHash": "sha256-/uilDXvCIEs3C9l73JTACm4quuHUsIHcns1c+cHUJwA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4c2fcb090b1f3e5b47eaa7bd33913b574a11e0a0",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_6": {
"locked": { "locked": {
"lastModified": 1726871744, "lastModified": 1726871744,
"narHash": "sha256-V5LpfdHyQkUF7RfOaDPrZDP+oqz88lTJrMT1+stXNwo=", "narHash": "sha256-V5LpfdHyQkUF7RfOaDPrZDP+oqz88lTJrMT1+stXNwo=",
@ -820,7 +682,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_7": { "nixpkgs_6": {
"locked": { "locked": {
"lastModified": 1656753965, "lastModified": 1656753965,
"narHash": "sha256-BCrB3l0qpJokOnIVc3g2lHiGhnjUi0MoXiw6t1o8H1E=", "narHash": "sha256-BCrB3l0qpJokOnIVc3g2lHiGhnjUi0MoXiw6t1o8H1E=",
@ -836,7 +698,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_8": { "nixpkgs_7": {
"locked": { "locked": {
"lastModified": 1726871744, "lastModified": 1726871744,
"narHash": "sha256-V5LpfdHyQkUF7RfOaDPrZDP+oqz88lTJrMT1+stXNwo=", "narHash": "sha256-V5LpfdHyQkUF7RfOaDPrZDP+oqz88lTJrMT1+stXNwo=",
@ -870,11 +732,11 @@
}, },
"nvf": { "nvf": {
"inputs": { "inputs": {
"flake-parts": "flake-parts_5", "flake-parts": "flake-parts_4",
"flake-utils": "flake-utils_4", "flake-utils": "flake-utils_3",
"mnw": "mnw", "mnw": "mnw",
"nil": "nil", "nil": "nil",
"nixpkgs": "nixpkgs_6", "nixpkgs": "nixpkgs_5",
"nmd": "nmd", "nmd": "nmd",
"plugin-alpha-nvim": "plugin-alpha-nvim", "plugin-alpha-nvim": "plugin-alpha-nvim",
"plugin-bufdelete-nvim": "plugin-bufdelete-nvim", "plugin-bufdelete-nvim": "plugin-bufdelete-nvim",
@ -2664,7 +2526,7 @@
"rnix-lsp": { "rnix-lsp": {
"inputs": { "inputs": {
"naersk": "naersk", "naersk": "naersk",
"nixpkgs": "nixpkgs_7", "nixpkgs": "nixpkgs_6",
"utils": "utils" "utils": "utils"
}, },
"locked": { "locked": {
@ -2685,15 +2547,13 @@
"inputs": { "inputs": {
"ags": "ags", "ags": "ags",
"basix": "basix", "basix": "basix",
"chaotic": "chaotic",
"firefox-addons": "firefox-addons", "firefox-addons": "firefox-addons",
"flake-parts": "flake-parts_2", "home-manager": "home-manager",
"flake-utils": "flake-utils_2",
"home-manager": "home-manager_2",
"lanzaboote": "lanzaboote", "lanzaboote": "lanzaboote",
"niri": "niri", "niri": "niri",
"nix-index-db": "nix-index-db",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_5", "nixpkgs": "nixpkgs_4",
"nvf": "nvf", "nvf": "nvf",
"plasma-manager": "plasma-manager", "plasma-manager": "plasma-manager",
"systems": "systems_5", "systems": "systems_5",
@ -2866,7 +2726,7 @@
}, },
"treefmt-nix": { "treefmt-nix": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_8" "nixpkgs": "nixpkgs_7"
}, },
"locked": { "locked": {
"lastModified": 1729242555, "lastModified": 1729242555,
@ -2899,7 +2759,7 @@
}, },
"wezterm": { "wezterm": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_5", "flake-utils": "flake-utils_4",
"freetype2": "freetype2", "freetype2": "freetype2",
"harfbuzz": "harfbuzz", "harfbuzz": "harfbuzz",
"libpng": "libpng", "libpng": "libpng",

View file

@ -1,85 +1,64 @@
{ {
description = "nezia's nixos configuration"; description = "nezia's nixos configuration";
outputs = inputs: outputs = {
inputs.flake-parts.lib.mkFlake {inherit inputs;} { self,
systems = ["x86_64-linux"]; nixpkgs,
systems,
imports = [ treefmt-nix,
./hosts ...
./modules } @ inputs: let
]; eachSystem = f: nixpkgs.lib.genAttrs (import systems) (system: f nixpkgs.legacyPackages.${system});
treefmtEval = eachSystem (pkgs: treefmt-nix.lib.evalModule pkgs ./treefmt.nix);
perSystem = {pkgs, ...}: { in {
devShells.default = pkgs.mkShell { devShells = eachSystem (pkgs: {
default = pkgs.mkShell {
packages = [ packages = [
pkgs.alejandra pkgs.alejandra
pkgs.git pkgs.git
]; ];
}; };
formatter = pkgs.alejandra; });
formatter = eachSystem (pkgs: treefmtEval.${pkgs.system}.config.build.wrapper);
nixosModules = import ./modules;
nixosConfigurations = import ./hosts {inherit self inputs;};
}; };
};
inputs = { inputs = {
# global, so they can be `.follow`ed # nix related
systems.url = "github:nix-systems/default-linux";
flake-utils = {
url = "github:numtide/flake-utils";
inputs.systems.follows = "systems";
};
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
chaotic.url = "github:chaotic-cx/nyx/nyxpkgs-unstable"; systems.url = "github:nix-systems/default-linux";
nixos-hardware.url = "github:NixOS/nixos-hardware";
firefox-addons = { lanzaboote = {
url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; url = "github:nix-community/lanzaboote/v0.4.1";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
home-manager = { home-manager = {
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nix-index-db = {
wezterm = { url = "github:nix-community/nix-index-database";
url = "github:wez/wezterm/main?dir=nix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nvf = { # other
url = "github:notashelf/nvf"; ags.url = "github:Aylur/ags";
};
basix.url = "github:notashelf/basix"; basix.url = "github:notashelf/basix";
firefox-addons = {
url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
inputs.nixpkgs.follows = "nixpkgs";
};
niri = {url = "github:sodiboo/niri-flake";};
nvf.url = "github:notashelf/nvf";
plasma-manager = { plasma-manager = {
url = "github:nix-community/plasma-manager"; url = "github:nix-community/plasma-manager";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager"; inputs.home-manager.follows = "home-manager";
}; };
treefmt-nix.url = "github:numtide/treefmt-nix";
ags.url = "github:Aylur/ags"; wezterm = {
url = "github:wez/wezterm/main?dir=nix";
niri = {
url = "github:sodiboo/niri-flake";
};
lanzaboote = {
url = "github:nix-community/lanzaboote/v0.4.1";
# Optional but recommended to limit the size of your system closure.
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
treefmt-nix.url = "github:numtide/treefmt-nix";
nixos-hardware.url = "github:NixOS/nixos-hardware";
}; };
} }

View file

@ -1,5 +1,4 @@
{ {
lib,
inputs, inputs,
pkgs, pkgs,
... ...
@ -61,7 +60,6 @@ in {
profiles = { profiles = {
nezia = { nezia = {
settings = { settings = {
"browser.urlbar.suggest.searches" = true;
"browser.search.suggest.enabled" = true; "browser.search.suggest.enabled" = true;
"ui.key.menuAccessKeyFocuses" = false; "ui.key.menuAccessKeyFocuses" = false;
}; };
@ -73,48 +71,12 @@ in {
stylus stylus
ublock-origin ublock-origin
violentmonkey violentmonkey
idontcareaboutcookies
]; ];
# https://git.jacekpoz.pl/poz/niksos/src/commit/a48647a1c5bc6877a1100a65f4dc169b2fc11ed7/hosts/hape/firefox.nix # https://git.jacekpoz.pl/poz/niksos/src/commit/a48647a1c5bc6877a1100a65f4dc169b2fc11ed7/hosts/hape/firefox.nix
search = { search = {
default = "SearxNG"; default = "SearxNG";
engines = { engines = {
"Nix Packages" = {
urls = [
{
template = "https://search.nixos.org/packages";
params = [
{
name = "type";
value = "packages";
}
{
name = "query";
value = "{searchTerms}";
}
];
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = ["@np"];
};
"NixOS Wiki" = {
urls = [{template = "https://wiki.nixos.org/w/index.php?search={searchTerms}";}];
iconUpdateURL = "https://wiki.nixos.org/favicon.ico";
updateInterval = 24 * 60 * 60 * 1000; # every day
definedAliases = ["@nw"];
};
"Home Manager Options" = {
urls = [{template = "https://home-manager-options.extranix.com/?release=master&query={searchTerms}";}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = ["@hm"];
};
"Arch Wiki" = {
urls = [{template = "https://wiki.archlinux.org/index.php?search={searchTerms}";}];
icon = "https://archlinux.org/favicon.ico";
definedAliases = ["@aw"];
};
"SearxNG" = { "SearxNG" = {
urls = [ urls = [
{ {
@ -139,13 +101,56 @@ in {
"type" = "application/x-suggestions+json"; "type" = "application/x-suggestions+json";
} }
]; ];
definedAliases = ["@sx"]; iconUpdateURL = "https://searx.tiekoetter.com/favicon.ico";
updateInterval = 24 * 60 * 60 * 1000;
definedAliases = ["@s"];
};
"Nix Packages" = {
urls = [
{
template = "https://search.nixos.org/packages";
params = [
{
name = "type";
value = "packages";
}
{
name = "query";
value = "{searchTerms}";
}
];
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = ["@np"];
};
"NixOS Wiki" = {
urls = [{template = "https://wiki.nixos.org/w/index.php?search={searchTerms}";}];
iconUpdateURL = "https://wiki.nixos.org/favicon.ico";
updateInterval = 24 * 60 * 60 * 1000;
definedAliases = ["@nw"];
};
"NixOS Options" = {
urls = [{template = "https://search.nixos.org/options?channel=unstable&type=packages&query={searchTerms}";}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = ["@no"];
};
"Noogle" = {
urls = [{template = "https://noogle.dev/q?term={searchTerms}";}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = ["@ng"];
};
"Home Manager" = {
urls = [{template = "https://home-manager-options.extranix.com/?release=master&query={searchTerms}";}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = ["@hm"];
}; };
"Google".metaData.alias = "@g"; # builtin engines only support specifying one additional alias "Google".metaData.alias = "@g"; # builtin engines only support specifying one additional alias
}; };
}; };
# https://github.com/oddlama/nix-config/blob/main/users/myuser/graphical/firefox.nix#L53-L57 # https://github.com/oddlama/nix-config/blob/main/users/myuser/graphical/firefox.nix#L53-L57
extraConfig = builtins.concatStringsSep "\n" [ extraConfig = builtins.concatStringsSep "\n" [
(builtins.readFile "${betterfox}/user.js")
(builtins.readFile "${betterfox}/Securefox.js") (builtins.readFile "${betterfox}/Securefox.js")
(builtins.readFile "${betterfox}/Fastfox.js") (builtins.readFile "${betterfox}/Fastfox.js")
(builtins.readFile "${betterfox}/Peskyfox.js") (builtins.readFile "${betterfox}/Peskyfox.js")

View file

@ -1,6 +1,6 @@
{ {
inputs, inputs,
nixosConfig, osConfig,
lib, lib,
pkgs, pkgs,
... ...
@ -15,7 +15,7 @@
font = "monospace:size=14"; font = "monospace:size=14";
}; };
colors = let colors = let
inherit (inputs.basix.schemeData.base16.${nixosConfig.style.scheme}) palette; inherit (inputs.basix.schemeData.base16.${osConfig.theme.scheme}) palette;
in { in {
background = "${palette.base00}ff"; background = "${palette.base00}ff";
text = "${palette.base05}ff"; text = "${palette.base05}ff";

View file

@ -6,10 +6,10 @@
lib, lib,
... ...
}: let }: let
isDark = inputs.basix.schemeData.base16.${osConfig.style.scheme}.variant == "dark"; isDark = inputs.basix.schemeData.base16.${osConfig.theme.scheme}.variant == "dark";
in { in {
home.pointerCursor = { home.pointerCursor = {
inherit (osConfig.style.cursorTheme) name package size; inherit (osConfig.theme.cursorTheme) name package size;
gtk.enable = true; gtk.enable = true;
x11.enable = true; x11.enable = true;
}; };
@ -35,11 +35,11 @@ in {
gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc"; gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
iconTheme = { iconTheme = {
inherit (osConfig.style.gtk.iconTheme) name package; inherit (osConfig.theme.gtk.iconTheme) name package;
}; };
theme = lib.mkIf (!osConfig.services.xserver.desktopManager.gnome.enable) { theme = lib.mkIf (!osConfig.services.xserver.desktopManager.gnome.enable) {
inherit (osConfig.style.gtk.theme) name package; inherit (osConfig.theme.gtk.theme) name package;
}; };
}; };
dconf.settings = { dconf.settings = {

View file

@ -6,7 +6,7 @@
osConfig, osConfig,
... ...
}: let }: let
colors = inputs.basix.schemeData.base16.${osConfig.style.scheme}.palette; colors = inputs.basix.schemeData.base16.${osConfig.theme.scheme}.palette;
in { in {
imports = [./binds.nix]; imports = [./binds.nix];

View file

@ -2,7 +2,7 @@
{ {
pkgs, pkgs,
lib, lib,
nixosConfig, osConfig,
... ...
}: { }: {
systemd.user.services.swaybg = { systemd.user.services.swaybg = {
@ -11,7 +11,7 @@
PartOf = ["graphical-session.target"]; PartOf = ["graphical-session.target"];
}; };
Service = { Service = {
ExecStart = "${lib.getExe pkgs.swaybg} -i ${nixosConfig.style.wallpaper} -m fill"; ExecStart = "${lib.getExe pkgs.swaybg} -i ${osConfig.theme.wallpaper} -m fill";
Restart = "on-failure"; Restart = "on-failure";
}; };
Install.WantedBy = ["graphical-session.target"]; Install.WantedBy = ["graphical-session.target"];

View file

@ -1,10 +1,10 @@
{ {
inputs, inputs,
pkgs, pkgs,
nixosConfig, osConfig,
... ...
}: let }: let
inherit (inputs.basix.schemeData.base16.${nixosConfig.style.scheme}) palette; inherit (inputs.basix.schemeData.base16.${osConfig.theme.scheme}) palette;
in { in {
# requires `security.pam.services.swaylock = { };` at the system level or else # requires `security.pam.services.swaylock = { };` at the system level or else
# unlock will not work. # unlock will not work.

View file

@ -1,6 +1,6 @@
{ {
inputs, inputs,
nixosConfig, osConfig,
config, config,
lib, lib,
... ...
@ -14,7 +14,7 @@
shell = "${lib.getExe config.programs.fish.package}"; shell = "${lib.getExe config.programs.fish.package}";
}; };
colors = let colors = let
schemeData = inputs.basix.schemeData.base16.${nixosConfig.style.scheme}; schemeData = inputs.basix.schemeData.base16.${osConfig.theme.scheme};
in { in {
background = schemeData.palette.base00; background = schemeData.palette.base00;
foreground = schemeData.palette.base05; foreground = schemeData.palette.base05;

View file

@ -5,6 +5,7 @@
./tmux.nix ./tmux.nix
./direnv.nix ./direnv.nix
./zellij.nix ./zellij.nix
./nix-index.nix
]; ];
home.packages = with pkgs; [ home.packages = with pkgs; [

View file

@ -0,0 +1,11 @@
{inputs, ...}: {
imports = [inputs.nix-index-db.hmModules.nix-index];
programs = {
nix-index = {
enable = true;
symlinkToCacheHome = true; # needed for comma
};
command-not-found.enable = false;
nix-index-database.comma.enable = true;
};
}

25
hosts/README.md Normal file
View file

@ -0,0 +1,25 @@
# 💻 Hosts
This directory contains the entry points for different NixOS system configurations. Each host represents a complete system configuration, combining NixOS system settings and Home Manager configurations.
## Components
### default.nix
The `default.nix` file in each host directory serves as the main entry point for the system configuration. It:
- Sets up NixOS configurations
- Sets up Home Manager configurations
- References host-specific module declarations
### modules/
The `modules/` directory contains host-specific declarations for custom modules that are defined in the flake's `nixosModules` output. This so far only includes global theme / style related declarations.
## Adding a New Host
1. Create a new directory for the host
2. Add a `hardware-configuration.nix` generated with `nixos-generate-config`
3. Add a `default.nix` that imports the desired configurations
4. Create host-specific module declarations in the `modules/` subdirectory to customize the global modules as needed
5. Reference the new host in `hosts/default.nix`

View file

@ -2,48 +2,30 @@
self, self,
inputs, inputs,
... ...
}: { }: let
flake.nixosConfigurations = let
inherit (inputs.nixpkgs.lib) nixosSystem; inherit (inputs.nixpkgs.lib) nixosSystem;
specialArgs = { specialArgs = {
inherit inputs self; inherit inputs self;
}; };
in { in {
vamos = nixosSystem { vamos = nixosSystem {
system = "x86_64-linux";
inherit specialArgs; inherit specialArgs;
modules = [ modules = [
./vamos ./vamos
self.nixosModules.style self.nixosModules.theme
({pkgs, ...}: {
style = let
wallpaper = pkgs.fetchurl {
url = "https://raw.githubusercontent.com/NixOS/nixos-artwork/e0cf0eb237dc5baba86661a3572b20a6183c1876/wallpapers/nix-wallpaper-nineish-catppuccin-frappe.png?raw=true";
hash = "sha256-/HAtpGwLxjNfJvX5/4YZfM8jPNStaM3gisK8+ImRmQ4=";
};
in {
gtk.enable = true;
inherit wallpaper;
};
})
inputs.nixos-hardware.nixosModules.framework-13-7040-amd inputs.nixos-hardware.nixosModules.framework-13-7040-amd
]; ];
}; };
solaire = nixosSystem { solaire = nixosSystem {
system = "x86_64-linux";
inherit specialArgs; inherit specialArgs;
modules = [ modules = [
./solaire ./solaire
self.nixosModules.style self.nixosModules.theme
{
style = {
gtk.enable = false;
wallpaper = ../wallpapers/lucy-edgerunners-wallpaper.jpg;
};
}
]; ];
}; };
};
} }

View file

@ -7,6 +7,7 @@
in { in {
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
./modules
"${mod}" "${mod}"
"${mod}/hardware/uni-sync.nix" "${mod}/hardware/uni-sync.nix"

View file

@ -0,0 +1,3 @@
{
imports = [./theme.nix];
}

View file

@ -0,0 +1,3 @@
{
theme.wallpaper = ../../wallpapers/lucy-edgerunners-wallpaper.jpg;
}

View file

@ -7,6 +7,7 @@
in { in {
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
./modules
"${mod}" "${mod}"
"${mod}/core/lanzaboote.nix" "${mod}/core/lanzaboote.nix"

View file

@ -0,0 +1,3 @@
{
imports = [./theme.nix];
}

View file

@ -0,0 +1,8 @@
{pkgs, ...}: {
theme = {
wallpaper = pkgs.fetchurl {
url = "https://raw.githubusercontent.com/NixOS/nixos-artwork/e0cf0eb237dc5baba86661a3572b20a6183c1876/wallpapers/nix-wallpaper-nineish-catppuccin-frappe.png?raw=true";
hash = "sha256-/HAtpGwLxjNfJvX5/4YZfM8jPNStaM3gisK8+ImRmQ4=";
};
};
}

View file

@ -1,5 +1,3 @@
{ {
flake.nixosModules = { theme = import ./theme;
style = import ./style;
};
} }

View file

@ -7,7 +7,7 @@
inherit (lib.types) string path package; inherit (lib.types) string path package;
in { in {
imports = [./gtk.nix]; imports = [./gtk.nix];
options.style = { options.theme = {
scheme = mkOption { scheme = mkOption {
description = '' description = ''
Name of the tinted-scheming color scheme to use. Name of the tinted-scheming color scheme to use.
@ -22,6 +22,10 @@ in {
''; '';
type = path; type = path;
example = lib.literalExpression "./wallpaper.png"; example = lib.literalExpression "./wallpaper.png";
default = pkgs.fetchurl {
url = "https://raw.githubusercontent.com/NixOS/nixos-artwork/e0cf0eb237dc5baba86661a3572b20a6183c1876/wallpapers/nix-wallpaper-nineish-catppuccin-frappe.png?raw=true";
hash = "sha256-/HAtpGwLxjNfJvX5/4YZfM8jPNStaM3gisK8+ImRmQ4=";
};
}; };
cursorTheme = { cursorTheme = {

View file

@ -8,9 +8,9 @@
inherit (lib) mkOption mkEnableOption; inherit (lib) mkOption mkEnableOption;
inherit (lib.types) package str; inherit (lib.types) package str;
cfg = config.style.gtk; cfg = config.theme.gtk;
in { in {
options.style.gtk = { options.theme.gtk = {
enable = mkEnableOption "enable GTK theming options"; enable = mkEnableOption "enable GTK theming options";
theme = { theme = {
name = mkOption { name = mkOption {
@ -57,7 +57,7 @@ in {
${toString themePath} set by the GTK module does not exist! ${toString themePath} set by the GTK module does not exist!
To suppress this message, make sure that To suppress this message, make sure that
`config.modules.style.gtk.theme.package` contains `config.modules.theme.gtk.theme.package` contains
the path `${cfg.theme.name}` the path `${cfg.theme.name}`
''; '';
}) })

View file

@ -1,6 +1,10 @@
# TODO: maybe use flake-parts {pkgs, ...}: {
{...}: {
# Used to find the project root
projectRootFile = "flake.nix"; projectRootFile = "flake.nix";
programs.alejandra.enable = true; programs = {
alejandra.enable = true;
prettier = {
enable = true;
package = pkgs.prettierd;
};
};
} }