Compare commits

...

19 commits

Author SHA1 Message Date
66ff9820f8
shared/nixosModules/style: use sharedModules 2024-12-18 19:23:28 +01:00
1271294049
treewide: remove unused nvidia file 2024-12-18 19:23:13 +01:00
ab18a42418
flake: remove uneeded directory for nodes 2024-12-18 19:02:34 +01:00
f8afc9f461
shared/nixosModules/style: split everything into its file 2024-12-18 18:43:19 +01:00
851a4d0d32
repo: update README 2024-12-18 11:15:40 +01:00
e01237d59a
hosts/solaire: delete unused modules directory 2024-12-18 11:00:56 +01:00
1c3665ec1c
pkgs: move to shared/pkgs 2024-12-18 11:00:24 +01:00
587e8d321b
treewide: split up options from theming module, rename to style
As an initial step towards refactoring the theming module, the options
have been split up from the configuration itself. This will allow to
find available options quicker, and separate concerns nicely. It was
also renamed to style, to avoid confusion with its own options (eg.
gtk.theme).
2024-12-18 10:57:03 +01:00
87bb04f065
config/nixos/core/boot: remove unused arguments 2024-12-18 10:19:59 +01:00
8e7c0584ef
hosts: move host-specific configuration to hosts/{host}/config 2024-12-18 10:19:46 +01:00
a600143e8a
nvidia: move to hosts/solaire 2024-12-18 10:19:24 +01:00
7174a33a44
treewide: reorganize general structure 2024-12-18 10:14:06 +01:00
b86f1470ed
hosts/solaire: set global vars 2024-12-18 10:03:08 +01:00
de6ea242c0
system/network: replace hard-coded values with global vars 2024-12-18 09:24:59 +01:00
5acf11adca
system/core/users: replace hard-coded values with global vars 2024-12-18 09:24:51 +01:00
96425172a0
hosts/vamos: set global vars 2024-12-18 09:24:30 +01:00
8338818b7d
hosts: import local modules by default 2024-12-18 09:24:23 +01:00
ffb60ac869
flake: update eachSystem to use lib.systems.flakeExposed 2024-12-18 09:23:54 +01:00
e98a15db1d
modules: create modules to hold global variables 2024-12-18 09:23:33 +01:00
131 changed files with 1120 additions and 875 deletions

View file

@ -4,31 +4,29 @@ My NixOS configurations, using flakes.
# </> Software I use
- Wayland compositor: [niri](https://github.com/YaLTeR/niri)
- Wayland compositor: [Hyprland](https://github.com/hyprwm/Hyprland)
- Text editor: [neovim](https://github.com/neovim/neovim)
- Shell: [fish](https://github.com/fish-shell/fish-shell)
- Colors: [Catppuccin](https://github.com/catppuccin/catppuccin)
- 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.
# 🛠️ Structure
| Name | Description |
| ------------------- | -------------------------- |
| [home](home/) | Home manager configuration |
| ----------------- | ------------------------------------------------------------- |
| [assets](assets/) | Resources used throughout the system (images etc.) |
| [config](config/) | System configuration (separated between NixOS / home-manager) |
| [hosts](hosts/) | Host-specific |
| [lib](lib/) | Helper functions |
| [modules](modules/) | NixOS modules |
| [pkgs](pkgs/) | Custom packages |
| [system](system/) | NixOS configuration |
| [shared](shared/) | Re-used components (internal modules, custom derivations) |
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.
3. Setting up theming should be as simple as changing one or two options.
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.
The main configuration can be found in [config](config/), which declares most of my programs, with re-usable modules and derivations in [shared](shared/), to provide a way to globally set themes, usernames and more.
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.
@ -39,5 +37,6 @@ People / repositories I have copied / learned from:
- [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
- [sodiboo](https://github.com/sodiboo) for helping me a whole lot with Niri-specific issues
- [llakala](https://github.com/llakala) for being very thorough and helpful when cleaning up my code and general structure.
Some bits have also been borrowed from within the configuration, and credit has been given where its due.

View file

@ -1,12 +1,12 @@
{
{osConfig, ...}: {
imports = [
./services/udiskie.nix
./terminal
./programs
];
home = {
username = "nezia";
homeDirectory = "/home/nezia";
home = rec {
inherit (osConfig.local.systemVars) username;
homeDirectory = "/home/${username}";
stateVersion = "24.05";
};

View file

@ -26,7 +26,7 @@
color-scheme = "prefer-dark";
};
"org/gnome/desktop/background" = {
picture-uri-dark = "file://" + builtins.toString osConfig.theme.wallpaper;
picture-uri-dark = "file://" + builtins.toString osConfig.local.style.wallpaper;
};
"org/gnome/desktop/search-providers" = {

View file

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

View file

@ -1,4 +1,4 @@
{pkgs, ...}: {
_: {
boot = {
loader = {
timeout = 0;

View file

@ -1,7 +1,7 @@
{
users.users.nezia = {
{config, ...}: {
users.users.${config.local.systemVars.username} = {
isNormalUser = true;
description = "Anthony Rodriguez";
description = config.local.homeVars.fullName or "User";
extraGroups = [
"networkmanager"
"audio"

View file

@ -1,5 +1,6 @@
{
{config, ...}: {
networking = {
inherit (config.local.systemVars) hostName;
networkmanager = {
enable = true;
dns = "systemd-resolved";

View file

@ -1,4 +1,5 @@
{
config,
inputs,
lib,
pkgs,
@ -36,7 +37,7 @@ in {
settings = {
default_session = {
command = "${Hyprland} --config ${hyprlandConfig}";
user = "nezia";
user = config.local.systemVars.username;
};
};
};

View file

@ -3234,7 +3234,6 @@
"nvf": "nvf",
"plasma-manager": "plasma-manager",
"portfolio": "portfolio",
"systems": "systems_7",
"treefmt-nix": "treefmt-nix"
}
},
@ -3391,21 +3390,6 @@
"type": "github"
}
},
"systems_7": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default-linux",
"type": "github"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": "nixpkgs_9"

View file

@ -4,13 +4,12 @@
outputs = {
self,
nixpkgs,
systems,
agenix,
deploy-rs,
treefmt-nix,
...
} @ inputs: let
eachSystem = f: nixpkgs.lib.genAttrs (import systems) (system: f nixpkgs.legacyPackages.${system});
eachSystem = f: nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed (system: f nixpkgs.legacyPackages.${system});
treefmtEval = eachSystem (pkgs: treefmt-nix.lib.evalModule pkgs ./treefmt.nix);
in {
devShells = eachSystem (pkgs: {
@ -25,14 +24,13 @@
});
formatter = eachSystem (pkgs: treefmtEval.${pkgs.system}.config.build.wrapper);
nixosConfigurations = import ./hosts {inherit inputs;};
packages = eachSystem (pkgs: import ./pkgs {inherit inputs pkgs;});
deploy.nodes = import ./nodes {inherit inputs;};
packages = eachSystem (pkgs: import ./shared/pkgs {inherit inputs pkgs;});
deploy.nodes = import ./nodes.nix {inherit inputs;};
checks = builtins.mapAttrs (_: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
};
inputs = {
# nix related
nixpkgs.url = "nixpkgs/nixos-unstable";
systems.url = "github:nix-systems/default-linux";
nixos-hardware.url = "github:NixOS/nixos-hardware";
lanzaboote = {
url = "github:nix-community/lanzaboote/v0.4.1";

View file

@ -1,15 +1,14 @@
{inputs, ...}: let
lib' = import ../lib;
lib' = import ../shared/lib;
mkSystem = args:
inputs.nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs lib';};
modules = args.modules or [];
modules = [../shared/nixosModules] ++ (args.modules or []);
};
in {
vamos = mkSystem {
modules = [
./vamos
../modules
inputs.nixos-hardware.nixosModules.framework-13-7040-amd
];
};
@ -17,7 +16,6 @@ in {
solaire = mkSystem {
modules = [
./solaire
../modules
];
};

View file

@ -1,5 +1,5 @@
_: {
theme = {
local.style = {
enable = true;
wallpaper = ../../../assets/wallpapers/lucy-edgerunners-wallpaper.jpg;
};

View file

@ -3,54 +3,63 @@
specialArgs,
...
}: let
system = "${inputs.self}/system";
home = "${inputs.self}/home";
nixos = "${inputs.self}/config/nixos";
hm = "${inputs.self}/config/home-manager";
in {
local.systemVars = {
hostName = "solaire";
username = "nezia";
};
local.homeVars = {
fullName = "Anthony Rodriguez";
email = "anthony@nezia.dev";
};
imports = [
./hardware-configuration.nix
./modules
./config/nvidia.nix
./config/theme.nix
system
"${system}/hardware/uni-sync.nix"
nixos
"${nixos}/hardware/uni-sync.nix"
"${system}/programs/games.nix"
"${system}/hardware/nvidia.nix"
"${nixos}/programs/games.nix"
"${system}/services/logind.nix"
"${system}/services/greetd.nix"
"${nixos}/services/logind.nix"
"${nixos}/services/greetd.nix"
"${system}/programs/hyprland.nix"
"${system}/services/gnome.nix"
"${nixos}/programs/hyprland.nix"
"${nixos}/services/gnome.nix"
"${system}/services/documentation.nix"
"${nixos}/services/documentation.nix"
"${system}/services/flatpak.nix"
"${nixos}/services/flatpak.nix"
];
home-manager = {
users.nezia.imports = [
"${home}"
"${home}/services/udiskie.nix"
"${home}/programs/games"
hm
"${hm}/services/udiskie.nix"
"${hm}/programs/games"
"${home}/programs/waybar"
"${home}/programs/fuzzel.nix"
"${home}/programs/hypr"
"${hm}/programs/waybar"
"${hm}/programs/fuzzel.nix"
"${hm}/programs/hypr"
"${home}/services/swaync"
"${home}/programs/swaybg.nix"
"${home}/programs/swaylock.nix"
"${hm}/services/swaync"
"${hm}/programs/swaybg.nix"
"${hm}/programs/swaylock.nix"
"${home}/terminal/emulators/foot.nix"
"${hm}/terminal/emulators/foot.nix"
"${home}/services/flatpak.nix"
"${home}/services/syncthing.nix"
"${hm}/services/flatpak.nix"
"${hm}/services/syncthing.nix"
"${home}/programs/editors/neovim.nix"
"${hm}/programs/editors/neovim.nix"
];
extraSpecialArgs = specialArgs;
};
networking.hostName = "solaire";
environment.variables.FLAKE = "/home/nezia/.dotfiles";
}

View file

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

View file

@ -1,5 +1,5 @@
{pkgs, ...}: {
theme = {
local.style = {
enable = true;
wallpaper = pkgs.fetchurl {
url = "https://raw.githubusercontent.com/NixOS/nixos-artwork/e0cf0eb237dc5baba86661a3572b20a6183c1876/wallpapers/nix-wallpaper-nineish-catppuccin-frappe.png?raw=true";

View file

@ -3,53 +3,62 @@
specialArgs,
...
}: let
system = "${inputs.self}/system";
home = "${inputs.self}/home";
nixos = "${inputs.self}/config/nixos";
hm = "${inputs.self}/config/home-manager";
in {
local.systemVars = {
hostName = "vamos";
username = "nezia";
};
local.homeVars = {
fullName = "Anthony Rodriguez";
email = "anthony@nezia.dev";
};
imports = [
./hardware-configuration.nix
./modules
./config/theme.nix
"${system}"
"${system}/core/lanzaboote.nix"
"${nixos}"
"${nixos}/core/lanzaboote.nix"
"${system}/hardware/fprintd.nix"
"${system}/services/power.nix"
"${system}/services/brightness.nix"
"${nixos}/hardware/fprintd.nix"
"${nixos}/services/power.nix"
"${nixos}/services/brightness.nix"
"${system}/services/logind.nix"
"${system}/services/greetd.nix"
"${system}/services/kanata.nix"
"${nixos}/services/logind.nix"
"${nixos}/services/greetd.nix"
"${nixos}/services/kanata.nix"
"${system}/programs/hyprland.nix"
"${system}/services/gnome.nix"
"${system}/services/mail.nix"
"${nixos}/programs/hyprland.nix"
"${nixos}/services/gnome.nix"
"${nixos}/services/mail.nix"
"${system}/services/documentation.nix"
"${nixos}/services/documentation.nix"
];
home-manager = {
users.nezia.imports = [
"${home}"
"${home}/services/udiskie.nix"
"${hm}"
"${hm}/services/udiskie.nix"
"${home}/programs/hypr"
"${home}/programs/waybar"
"${home}/programs/fuzzel.nix"
"${hm}/programs/hypr"
"${hm}/programs/waybar"
"${hm}/programs/fuzzel.nix"
"${home}/services/swaync"
"${home}/programs/swaybg.nix"
"${home}/programs/wlogout.nix"
"${hm}/services/swaync"
"${hm}/programs/swaybg.nix"
"${hm}/programs/wlogout.nix"
"${home}/services/syncthing.nix"
"${hm}/services/syncthing.nix"
"${home}/programs/editors/neovim.nix"
"${hm}/programs/editors/neovim.nix"
"${home}/terminal/emulators/foot.nix"
"${hm}/terminal/emulators/foot.nix"
];
extraSpecialArgs = specialArgs;
};
networking.hostName = "vamos";
environment.variables.FLAKE = "/home/nezia/.dotfiles";
}

Some files were not shown because too many files have changed in this diff Show more