Compare commits
19 commits
main
...
structure-
Author | SHA1 | Date | |
---|---|---|---|
66ff9820f8 | |||
1271294049 | |||
ab18a42418 | |||
f8afc9f461 | |||
851a4d0d32 | |||
e01237d59a | |||
1c3665ec1c | |||
587e8d321b | |||
87bb04f065 | |||
8e7c0584ef | |||
a600143e8a | |||
7174a33a44 | |||
b86f1470ed | |||
de6ea242c0 | |||
5acf11adca | |||
96425172a0 | |||
8338818b7d | |||
ffb60ac869 | |||
e98a15db1d |
131 changed files with 1120 additions and 875 deletions
25
README.md
25
README.md
|
@ -4,31 +4,29 @@ My NixOS configurations, using flakes.
|
||||||
|
|
||||||
# </> Software I use
|
# </> 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)
|
- 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)
|
|
||||||
- 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 |
|
| [assets](assets/) | Resources used throughout the system (images etc.) |
|
||||||
| [hosts](hosts/) | Host-specific |
|
| [config](config/) | System configuration (separated between NixOS / home-manager) |
|
||||||
| [lib](lib/) | Helper functions |
|
| [hosts](hosts/) | Host-specific |
|
||||||
| [modules](modules/) | NixOS modules |
|
| [lib](lib/) | Helper functions |
|
||||||
| [pkgs](pkgs/) | Custom packages |
|
| [shared](shared/) | Re-used components (internal modules, custom derivations) |
|
||||||
| [system](system/) | NixOS configuration |
|
|
||||||
|
|
||||||
My configuration is structured based on the following principles:
|
My configuration is structured based on the following principles:
|
||||||
|
|
||||||
1. Hosts should be the main entry points and outputs.
|
1. Hosts should be the main entry points and outputs.
|
||||||
2. Abstractions should be avoided as much as possible.
|
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.
|
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
|
- [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
|
||||||
- [sodiboo](https://github.com/sodiboo) for helping me a whole lot with Niri-specific issues
|
- [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.
|
Some bits have also been borrowed from within the configuration, and credit has been given where its due.
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{osConfig, ...}: {
|
||||||
imports = [
|
imports = [
|
||||||
./services/udiskie.nix
|
./services/udiskie.nix
|
||||||
./terminal
|
./terminal
|
||||||
./programs
|
./programs
|
||||||
];
|
];
|
||||||
home = {
|
home = rec {
|
||||||
username = "nezia";
|
inherit (osConfig.local.systemVars) username;
|
||||||
homeDirectory = "/home/nezia";
|
homeDirectory = "/home/${username}";
|
||||||
stateVersion = "24.05";
|
stateVersion = "24.05";
|
||||||
};
|
};
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
color-scheme = "prefer-dark";
|
color-scheme = "prefer-dark";
|
||||||
};
|
};
|
||||||
"org/gnome/desktop/background" = {
|
"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" = {
|
"org/gnome/desktop/search-providers" = {
|
|
@ -11,7 +11,7 @@
|
||||||
PartOf = ["graphical-session.target"];
|
PartOf = ["graphical-session.target"];
|
||||||
};
|
};
|
||||||
Service = {
|
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";
|
Restart = "on-failure";
|
||||||
};
|
};
|
||||||
Install.WantedBy = ["graphical-session.target"];
|
Install.WantedBy = ["graphical-session.target"];
|
|
@ -1,4 +1,4 @@
|
||||||
{pkgs, ...}: {
|
_: {
|
||||||
boot = {
|
boot = {
|
||||||
loader = {
|
loader = {
|
||||||
timeout = 0;
|
timeout = 0;
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{config, ...}: {
|
||||||
users.users.nezia = {
|
users.users.${config.local.systemVars.username} = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
description = "Anthony Rodriguez";
|
description = config.local.homeVars.fullName or "User";
|
||||||
extraGroups = [
|
extraGroups = [
|
||||||
"networkmanager"
|
"networkmanager"
|
||||||
"audio"
|
"audio"
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{config, ...}: {
|
||||||
networking = {
|
networking = {
|
||||||
|
inherit (config.local.systemVars) hostName;
|
||||||
networkmanager = {
|
networkmanager = {
|
||||||
enable = true;
|
enable = true;
|
||||||
dns = "systemd-resolved";
|
dns = "systemd-resolved";
|
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
|
config,
|
||||||
inputs,
|
inputs,
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
|
@ -36,7 +37,7 @@ in {
|
||||||
settings = {
|
settings = {
|
||||||
default_session = {
|
default_session = {
|
||||||
command = "${Hyprland} --config ${hyprlandConfig}";
|
command = "${Hyprland} --config ${hyprlandConfig}";
|
||||||
user = "nezia";
|
user = config.local.systemVars.username;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
16
flake.lock
16
flake.lock
|
@ -3234,7 +3234,6 @@
|
||||||
"nvf": "nvf",
|
"nvf": "nvf",
|
||||||
"plasma-manager": "plasma-manager",
|
"plasma-manager": "plasma-manager",
|
||||||
"portfolio": "portfolio",
|
"portfolio": "portfolio",
|
||||||
"systems": "systems_7",
|
|
||||||
"treefmt-nix": "treefmt-nix"
|
"treefmt-nix": "treefmt-nix"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -3391,21 +3390,6 @@
|
||||||
"type": "github"
|
"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": {
|
"treefmt-nix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": "nixpkgs_9"
|
"nixpkgs": "nixpkgs_9"
|
||||||
|
|
|
@ -4,13 +4,12 @@
|
||||||
outputs = {
|
outputs = {
|
||||||
self,
|
self,
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
systems,
|
|
||||||
agenix,
|
agenix,
|
||||||
deploy-rs,
|
deploy-rs,
|
||||||
treefmt-nix,
|
treefmt-nix,
|
||||||
...
|
...
|
||||||
} @ inputs: let
|
} @ 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);
|
treefmtEval = eachSystem (pkgs: treefmt-nix.lib.evalModule pkgs ./treefmt.nix);
|
||||||
in {
|
in {
|
||||||
devShells = eachSystem (pkgs: {
|
devShells = eachSystem (pkgs: {
|
||||||
|
@ -25,14 +24,13 @@
|
||||||
});
|
});
|
||||||
formatter = eachSystem (pkgs: treefmtEval.${pkgs.system}.config.build.wrapper);
|
formatter = eachSystem (pkgs: treefmtEval.${pkgs.system}.config.build.wrapper);
|
||||||
nixosConfigurations = import ./hosts {inherit inputs;};
|
nixosConfigurations = import ./hosts {inherit inputs;};
|
||||||
packages = eachSystem (pkgs: import ./pkgs {inherit inputs pkgs;});
|
packages = eachSystem (pkgs: import ./shared/pkgs {inherit inputs pkgs;});
|
||||||
deploy.nodes = import ./nodes {inherit inputs;};
|
deploy.nodes = import ./nodes.nix {inherit inputs;};
|
||||||
checks = builtins.mapAttrs (_: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
|
checks = builtins.mapAttrs (_: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
|
||||||
};
|
};
|
||||||
inputs = {
|
inputs = {
|
||||||
# nix related
|
# nix related
|
||||||
nixpkgs.url = "nixpkgs/nixos-unstable";
|
nixpkgs.url = "nixpkgs/nixos-unstable";
|
||||||
systems.url = "github:nix-systems/default-linux";
|
|
||||||
nixos-hardware.url = "github:NixOS/nixos-hardware";
|
nixos-hardware.url = "github:NixOS/nixos-hardware";
|
||||||
lanzaboote = {
|
lanzaboote = {
|
||||||
url = "github:nix-community/lanzaboote/v0.4.1";
|
url = "github:nix-community/lanzaboote/v0.4.1";
|
||||||
|
|
|
@ -1,15 +1,14 @@
|
||||||
{inputs, ...}: let
|
{inputs, ...}: let
|
||||||
lib' = import ../lib;
|
lib' = import ../shared/lib;
|
||||||
mkSystem = args:
|
mkSystem = args:
|
||||||
inputs.nixpkgs.lib.nixosSystem {
|
inputs.nixpkgs.lib.nixosSystem {
|
||||||
specialArgs = {inherit inputs lib';};
|
specialArgs = {inherit inputs lib';};
|
||||||
modules = args.modules or [];
|
modules = [../shared/nixosModules] ++ (args.modules or []);
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
vamos = mkSystem {
|
vamos = mkSystem {
|
||||||
modules = [
|
modules = [
|
||||||
./vamos
|
./vamos
|
||||||
../modules
|
|
||||||
inputs.nixos-hardware.nixosModules.framework-13-7040-amd
|
inputs.nixos-hardware.nixosModules.framework-13-7040-amd
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
@ -17,7 +16,6 @@ in {
|
||||||
solaire = mkSystem {
|
solaire = mkSystem {
|
||||||
modules = [
|
modules = [
|
||||||
./solaire
|
./solaire
|
||||||
../modules
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
_: {
|
_: {
|
||||||
theme = {
|
local.style = {
|
||||||
enable = true;
|
enable = true;
|
||||||
wallpaper = ../../../assets/wallpapers/lucy-edgerunners-wallpaper.jpg;
|
wallpaper = ../../../assets/wallpapers/lucy-edgerunners-wallpaper.jpg;
|
||||||
};
|
};
|
|
@ -3,54 +3,63 @@
|
||||||
specialArgs,
|
specialArgs,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
system = "${inputs.self}/system";
|
nixos = "${inputs.self}/config/nixos";
|
||||||
home = "${inputs.self}/home";
|
hm = "${inputs.self}/config/home-manager";
|
||||||
in {
|
in {
|
||||||
|
local.systemVars = {
|
||||||
|
hostName = "solaire";
|
||||||
|
username = "nezia";
|
||||||
|
};
|
||||||
|
|
||||||
|
local.homeVars = {
|
||||||
|
fullName = "Anthony Rodriguez";
|
||||||
|
email = "anthony@nezia.dev";
|
||||||
|
};
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./modules
|
./config/nvidia.nix
|
||||||
|
./config/theme.nix
|
||||||
|
|
||||||
system
|
nixos
|
||||||
"${system}/hardware/uni-sync.nix"
|
"${nixos}/hardware/uni-sync.nix"
|
||||||
|
|
||||||
"${system}/programs/games.nix"
|
"${nixos}/programs/games.nix"
|
||||||
"${system}/hardware/nvidia.nix"
|
|
||||||
|
|
||||||
"${system}/services/logind.nix"
|
"${nixos}/services/logind.nix"
|
||||||
"${system}/services/greetd.nix"
|
"${nixos}/services/greetd.nix"
|
||||||
|
|
||||||
"${system}/programs/hyprland.nix"
|
"${nixos}/programs/hyprland.nix"
|
||||||
"${system}/services/gnome.nix"
|
"${nixos}/services/gnome.nix"
|
||||||
|
|
||||||
"${system}/services/documentation.nix"
|
"${nixos}/services/documentation.nix"
|
||||||
|
|
||||||
"${system}/services/flatpak.nix"
|
"${nixos}/services/flatpak.nix"
|
||||||
];
|
];
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
users.nezia.imports = [
|
users.nezia.imports = [
|
||||||
"${home}"
|
hm
|
||||||
"${home}/services/udiskie.nix"
|
"${hm}/services/udiskie.nix"
|
||||||
"${home}/programs/games"
|
"${hm}/programs/games"
|
||||||
|
|
||||||
"${home}/programs/waybar"
|
"${hm}/programs/waybar"
|
||||||
"${home}/programs/fuzzel.nix"
|
"${hm}/programs/fuzzel.nix"
|
||||||
"${home}/programs/hypr"
|
"${hm}/programs/hypr"
|
||||||
|
|
||||||
"${home}/services/swaync"
|
"${hm}/services/swaync"
|
||||||
"${home}/programs/swaybg.nix"
|
"${hm}/programs/swaybg.nix"
|
||||||
"${home}/programs/swaylock.nix"
|
"${hm}/programs/swaylock.nix"
|
||||||
|
|
||||||
"${home}/terminal/emulators/foot.nix"
|
"${hm}/terminal/emulators/foot.nix"
|
||||||
|
|
||||||
"${home}/services/flatpak.nix"
|
"${hm}/services/flatpak.nix"
|
||||||
"${home}/services/syncthing.nix"
|
"${hm}/services/syncthing.nix"
|
||||||
|
|
||||||
"${home}/programs/editors/neovim.nix"
|
"${hm}/programs/editors/neovim.nix"
|
||||||
];
|
];
|
||||||
extraSpecialArgs = specialArgs;
|
extraSpecialArgs = specialArgs;
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.hostName = "solaire";
|
|
||||||
environment.variables.FLAKE = "/home/nezia/.dotfiles";
|
environment.variables.FLAKE = "/home/nezia/.dotfiles";
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
{
|
|
||||||
imports = [./theme.nix];
|
|
||||||
}
|
|
|
@ -1,5 +1,5 @@
|
||||||
{pkgs, ...}: {
|
{pkgs, ...}: {
|
||||||
theme = {
|
local.style = {
|
||||||
enable = true;
|
enable = true;
|
||||||
wallpaper = pkgs.fetchurl {
|
wallpaper = pkgs.fetchurl {
|
||||||
url = "https://raw.githubusercontent.com/NixOS/nixos-artwork/e0cf0eb237dc5baba86661a3572b20a6183c1876/wallpapers/nix-wallpaper-nineish-catppuccin-frappe.png?raw=true";
|
url = "https://raw.githubusercontent.com/NixOS/nixos-artwork/e0cf0eb237dc5baba86661a3572b20a6183c1876/wallpapers/nix-wallpaper-nineish-catppuccin-frappe.png?raw=true";
|
|
@ -3,53 +3,62 @@
|
||||||
specialArgs,
|
specialArgs,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
system = "${inputs.self}/system";
|
nixos = "${inputs.self}/config/nixos";
|
||||||
home = "${inputs.self}/home";
|
hm = "${inputs.self}/config/home-manager";
|
||||||
in {
|
in {
|
||||||
|
local.systemVars = {
|
||||||
|
hostName = "vamos";
|
||||||
|
username = "nezia";
|
||||||
|
};
|
||||||
|
|
||||||
|
local.homeVars = {
|
||||||
|
fullName = "Anthony Rodriguez";
|
||||||
|
email = "anthony@nezia.dev";
|
||||||
|
};
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./modules
|
./config/theme.nix
|
||||||
|
|
||||||
"${system}"
|
"${nixos}"
|
||||||
"${system}/core/lanzaboote.nix"
|
"${nixos}/core/lanzaboote.nix"
|
||||||
|
|
||||||
"${system}/hardware/fprintd.nix"
|
"${nixos}/hardware/fprintd.nix"
|
||||||
"${system}/services/power.nix"
|
"${nixos}/services/power.nix"
|
||||||
"${system}/services/brightness.nix"
|
"${nixos}/services/brightness.nix"
|
||||||
|
|
||||||
"${system}/services/logind.nix"
|
"${nixos}/services/logind.nix"
|
||||||
"${system}/services/greetd.nix"
|
"${nixos}/services/greetd.nix"
|
||||||
"${system}/services/kanata.nix"
|
"${nixos}/services/kanata.nix"
|
||||||
|
|
||||||
"${system}/programs/hyprland.nix"
|
"${nixos}/programs/hyprland.nix"
|
||||||
"${system}/services/gnome.nix"
|
"${nixos}/services/gnome.nix"
|
||||||
"${system}/services/mail.nix"
|
"${nixos}/services/mail.nix"
|
||||||
|
|
||||||
"${system}/services/documentation.nix"
|
"${nixos}/services/documentation.nix"
|
||||||
];
|
];
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
users.nezia.imports = [
|
users.nezia.imports = [
|
||||||
"${home}"
|
"${hm}"
|
||||||
"${home}/services/udiskie.nix"
|
"${hm}/services/udiskie.nix"
|
||||||
|
|
||||||
"${home}/programs/hypr"
|
"${hm}/programs/hypr"
|
||||||
"${home}/programs/waybar"
|
"${hm}/programs/waybar"
|
||||||
"${home}/programs/fuzzel.nix"
|
"${hm}/programs/fuzzel.nix"
|
||||||
|
|
||||||
"${home}/services/swaync"
|
"${hm}/services/swaync"
|
||||||
"${home}/programs/swaybg.nix"
|
"${hm}/programs/swaybg.nix"
|
||||||
"${home}/programs/wlogout.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;
|
extraSpecialArgs = specialArgs;
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.hostName = "vamos";
|
|
||||||
environment.variables.FLAKE = "/home/nezia/.dotfiles";
|
environment.variables.FLAKE = "/home/nezia/.dotfiles";
|
||||||
}
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue