repo: huge refactor

Refactored the entire repository structure, as putting everything into
modules was just awkward. Took heavy inspiration from fufexan's
repository, fufexan/dotfiles, as the structure felt much saner.
This commit is contained in:
Anthony Rodriguez 2024-09-29 23:48:55 +02:00
parent e2ea722378
commit 8fe0604299
Signed by: nezia
GPG key ID: EE3BE97C040A86CE
87 changed files with 853 additions and 2225 deletions

View file

@ -1,136 +1,26 @@
{
"nodes": {
"base16": {
"inputs": {
"fromYaml": "fromYaml"
},
"locked": {
"lastModified": 1708890466,
"narHash": "sha256-LlrC09LoPi8OPYOGPXegD72v+//VapgAqhbOFS3i8sc=",
"owner": "SenchoPens",
"repo": "base16.nix",
"rev": "665b3c6748534eb766c777298721cece9453fdae",
"type": "github"
},
"original": {
"owner": "SenchoPens",
"repo": "base16.nix",
"type": "github"
}
},
"base16-fish": {
"flake": false,
"locked": {
"lastModified": 1622559957,
"narHash": "sha256-PebymhVYbL8trDVVXxCvZgc0S5VxI7I1Hv4RMSquTpA=",
"owner": "tomyun",
"repo": "base16-fish",
"rev": "2f6dd973a9075dabccd26f1cded09508180bf5fe",
"type": "github"
},
"original": {
"owner": "tomyun",
"repo": "base16-fish",
"type": "github"
}
},
"base16-foot": {
"flake": false,
"locked": {
"lastModified": 1696725948,
"narHash": "sha256-65bz2bUL/yzZ1c8/GQASnoiGwaF8DczlxJtzik1c0AU=",
"owner": "tinted-theming",
"repo": "base16-foot",
"rev": "eedbcfa30de0a4baa03e99f5e3ceb5535c2755ce",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "base16-foot",
"type": "github"
}
},
"base16-helix": {
"flake": false,
"locked": {
"lastModified": 1725860795,
"narHash": "sha256-Z2o8VBPW3I+KKTSfe25kskz0EUj7MpUh8u355Z1nVsU=",
"owner": "tinted-theming",
"repo": "base16-helix",
"rev": "7f795bf75d38e0eea9fed287264067ca187b88a9",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "base16-helix",
"type": "github"
}
},
"base16-kitty": {
"flake": false,
"locked": {
"lastModified": 1665001328,
"narHash": "sha256-aRaizTYPpuWEcvoYE9U+YRX+Wsc8+iG0guQJbvxEdJY=",
"owner": "kdrag0n",
"repo": "base16-kitty",
"rev": "06bb401fa9a0ffb84365905ffbb959ae5bf40805",
"type": "github"
},
"original": {
"owner": "kdrag0n",
"repo": "base16-kitty",
"type": "github"
}
},
"base16-tmux": {
"flake": false,
"locked": {
"lastModified": 1696725902,
"narHash": "sha256-wDPg5elZPcQpu7Df0lI5O8Jv4A3T6jUQIVg63KDU+3Q=",
"owner": "tinted-theming",
"repo": "base16-tmux",
"rev": "c02050bebb60dbb20cb433cd4d8ce668ecc11ba7",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "base16-tmux",
"type": "github"
}
},
"base16-vim": {
"flake": false,
"locked": {
"lastModified": 1716150083,
"narHash": "sha256-ZMhnNmw34ogE5rJZrjRv5MtG3WaqKd60ds2VXvT6hEc=",
"owner": "tinted-theming",
"repo": "base16-vim",
"rev": "6e955d704d046b0dc3e5c2d68a2a6eeffd2b5d3d",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "base16-vim",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1726153070,
"narHash": "sha256-HO4zgY0ekfwO5bX0QH/3kJ/h4KvUDFZg8YpkNwIbg1U=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "bcef6817a8b2aa20a5a6dbb19b43e63c5bf8619a",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_2": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
@ -150,14 +40,16 @@
},
"flake-utils": {
"inputs": {
"systems": "systems"
"systems": [
"systems"
]
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"lastModified": 1726560853,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
"type": "github"
},
"original": {
@ -168,10 +60,7 @@
},
"flake-utils_2": {
"inputs": {
"systems": [
"stylix",
"systems"
]
"systems": "systems"
},
"locked": {
"lastModified": 1710146030,
@ -189,7 +78,7 @@
},
"flake-utils_3": {
"inputs": {
"systems": "systems_5"
"systems": "systems_4"
},
"locked": {
"lastModified": 1710146030,
@ -222,39 +111,6 @@
"type": "github"
}
},
"fromYaml": {
"flake": false,
"locked": {
"lastModified": 1689549921,
"narHash": "sha256-iX0pk/uB019TdBGlaJEWvBCfydT6sRq+eDcGPifVsCM=",
"owner": "SenchoPens",
"repo": "fromYaml",
"rev": "11fbbbfb32e3289d3c631e0134a23854e7865c84",
"type": "github"
},
"original": {
"owner": "SenchoPens",
"repo": "fromYaml",
"type": "github"
}
},
"gnome-shell": {
"flake": false,
"locked": {
"lastModified": 1713702291,
"narHash": "sha256-zYP1ehjtcV8fo+c+JFfkAqktZ384Y+y779fzmR9lQAU=",
"owner": "GNOME",
"repo": "gnome-shell",
"rev": "0d0aadf013f78a7f7f1dc984d0d812971864b934",
"type": "github"
},
"original": {
"owner": "GNOME",
"ref": "46.1",
"repo": "gnome-shell",
"type": "github"
}
},
"harfbuzz": {
"flake": false,
"locked": {
@ -292,27 +148,6 @@
"type": "github"
}
},
"home-manager_2": {
"inputs": {
"nixpkgs": [
"stylix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1724435763,
"narHash": "sha256-UNky3lJNGQtUEXT2OY8gMxejakSWPTfWKvpFkpFlAfM=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "c2cd2a52e02f1dfa1c88f95abeb89298d46023be",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"libpng": {
"flake": false,
"locked": {
@ -436,22 +271,6 @@
"url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1725762081,
"narHash": "sha256-vNv+aJUW5/YurRy1ocfvs4q/48yVESwlC/yHzjkZSP8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "dc454045f5b5d814e5862a6d057e7bb5c29edc05",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "release-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1656753965,
@ -469,22 +288,6 @@
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1725194671,
"narHash": "sha256-tLGCFEFTB5TaOKkpfw3iYT9dnk4awTP/q4w+ROpMfuw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "b833ff01a0d694b910daca6e2ff4a3f26dee478c",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_4": {
"locked": {
"lastModified": 1726871744,
"narHash": "sha256-V5LpfdHyQkUF7RfOaDPrZDP+oqz88lTJrMT1+stXNwo=",
@ -500,7 +303,7 @@
"type": "github"
}
},
"nixpkgs_5": {
"nixpkgs_4": {
"locked": {
"lastModified": 1725634671,
"narHash": "sha256-v3rIhsJBOMLR8e/RNWxr828tB+WywYIoajrZKFM+0Gg=",
@ -534,8 +337,8 @@
},
"nvf": {
"inputs": {
"flake-parts": "flake-parts",
"flake-utils": "flake-utils",
"flake-parts": "flake-parts_2",
"flake-utils": "flake-utils_2",
"mnw": "mnw",
"nil": "nil",
"nixpkgs": [
@ -2282,13 +2085,13 @@
},
"root": {
"inputs": {
"flake-parts": "flake-parts",
"flake-utils": "flake-utils",
"home-manager": "home-manager",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs",
"nvf": "nvf",
"sops-nix": "sops-nix",
"stylix": "stylix",
"systems": "systems_4",
"systems": "systems_3",
"treefmt-nix": "treefmt-nix",
"wezterm": "wezterm",
"zen-browser": "zen-browser"
@ -2342,57 +2145,6 @@
"type": "github"
}
},
"sops-nix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1726524647,
"narHash": "sha256-qis6BtOOBBEAfUl7FMHqqTwRLB61OL5OFzIsOmRz2J4=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "e2d404a7ea599a013189aa42947f66cede0645c8",
"type": "github"
},
"original": {
"owner": "Mic92",
"repo": "sops-nix",
"type": "github"
}
},
"stylix": {
"inputs": {
"base16": "base16",
"base16-fish": "base16-fish",
"base16-foot": "base16-foot",
"base16-helix": "base16-helix",
"base16-kitty": "base16-kitty",
"base16-tmux": "base16-tmux",
"base16-vim": "base16-vim",
"flake-compat": "flake-compat",
"flake-utils": "flake-utils_2",
"gnome-shell": "gnome-shell",
"home-manager": "home-manager_2",
"nixpkgs": "nixpkgs_3",
"systems": "systems_3"
},
"locked": {
"lastModified": 1727093531,
"narHash": "sha256-hsb1bcUvpMecFHOP5F3LEyOnXiZ+5MikR92irJ8o7iE=",
"owner": "danth",
"repo": "stylix",
"rev": "eccb9f2d63f4582b1c1ffe97d806156147aeee5f",
"type": "github"
},
"original": {
"owner": "danth",
"repo": "stylix",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
@ -2425,34 +2177,20 @@
},
"systems_3": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"repo": "default-linux",
"type": "github"
}
},
"systems_4": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"id": "systems",
"type": "indirect"
}
},
"systems_5": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
@ -2469,7 +2207,7 @@
},
"treefmt-nix": {
"inputs": {
"nixpkgs": "nixpkgs_4"
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1727252110,
@ -2531,7 +2269,7 @@
},
"zen-browser": {
"inputs": {
"nixpkgs": "nixpkgs_5"
"nixpkgs": "nixpkgs_4"
},
"locked": {
"lastModified": 1726001766,

View file

@ -1,83 +1,63 @@
{
description = "nezia's nixos configuration";
outputs = {
nixpkgs,
systems,
home-manager,
sops-nix,
stylix,
treefmt-nix,
...
} @ inputs: let
username = "nezia";
system = "x86_64-linux";
# small tool to iterate over each systems
eachSystem = f: nixpkgs.lib.genAttrs (import systems) (system: f nixpkgs.legacyPackages.${system});
# eval the treefmt modules from ./treefmt.nix
treefmtEval = eachSystem (pkgs: treefmt-nix.lib.evalModule pkgs ./treefmt.nix);
outputs = inputs:
inputs.flake-parts.lib.mkFlake {inherit inputs;} {
systems = ["x86-64_linux"];
commonModules = hostname: [
./modules
./hosts/common
./hosts/${hostname}
sops-nix.nixosModules.sops
stylix.nixosModules.stylix
home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = {
inherit inputs system;
};
};
}
{
_module.args = {
inherit hostname username;
};
}
imports = [
./hosts
];
configureSystem = hostname: homeConfig:
nixpkgs.lib.nixosSystem {
inherit system;
modules = commonModules hostname ++ [{home-manager.users."${username}" = import homeConfig;}];
specialArgs = {
inherit inputs;
perSystem = {
config,
pkgs,
...
}: {
devShells.default = pkgs.mkShell {
packages = [
pkgs.alejandra
pkgs.git
];
};
formatter = pkgs.alejandra;
};
in {
nixosConfigurations = {
vamos = configureSystem "vamos" ./home/laptop;
solaire = configureSystem "solaire" ./home/desktop;
};
formatter = eachSystem (pkgs: treefmtEval.${pkgs.system}.config.build.wrapper);
};
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
# global, so they can be `.follow`ed
systems.url = "github:nix-systems/default-linux";
flake-utils = {
url = "github:numtide/flake-utils";
inputs.systems.follows = "systems";
};
stylix.url = "github:danth/stylix";
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
wezterm = {
url = "github:wez/wezterm/main?dir=nix";
inputs.nixpkgs.follows = "nixpkgs";
};
zen-browser.url = "github:MarceColl/zen-browser-flake";
nvf = {
url = "github:notashelf/nvf";
inputs.nixpkgs.follows = "nixpkgs";
};
treefmt-nix.url = "github:numtide/treefmt-nix";
nixos-hardware.url = "github:NixOS/nixos-hardware";
};
}

View file

@ -1,9 +0,0 @@
_: {
imports = [
./core.nix
./automount.nix
./mime.nix
./shell
./programs
];
}

View file

@ -1,16 +0,0 @@
{pkgs, ...}: {
xdg.mimeApps = {
enable = true;
# TODO: make this a module (this is impractical, i should make it more generic)
defaultApplications = {
"default-web-browser" = ["floorp.desktop"];
"text/html" = ["floorp.desktop"];
"x-scheme-handler/http" = ["floorp.desktop"];
"x-scheme-handler/https" = ["floorp.desktop"];
"x-scheme-handler/about" = ["floorp.desktop"];
"x-scheme-handler/unknown" = ["floorp.desktop"];
"application/pdf" = ["org.gnome.Evince.desktop"];
"audio/wav" = ["rhythmbox"];
};
};
}

View file

@ -1,8 +0,0 @@
_: {
imports = [
./git.nix
./gnupg.nix
./browsers.nix
./miscellaneous.nix
];
}

View file

@ -1,11 +0,0 @@
_: {
programs.gpg = {
enable = true;
publicKeys = [
{
source = ./nezia-public-key.asc;
trust = 5;
}
];
};
}

View file

@ -1,15 +0,0 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Comment: Hostname:
Version: Hockeypuck 2.2
xjMEZKvcMBYJKwYBBAHaRw8BAQdAaYkPQIOlp8VGA4IsxNUz+EVjViDRmh0lQu1H
UGnY5XbNJUFudGhvbnkgUm9kcmlndWV6IDxhbnRob255QG5lemlhLmRldj7CkwQT
FgoAOxYhBCKjzYm9/VFRuQ4xqO476XwECobOBQJkq9wwAhsDBQsJCAcCAiICBhUK
CQgLAgQWAgMBAh4HAheAAAoJEO476XwECobOsQAA/j73e84XCql0D43q11eko5Cd
c8yx9oepeW6YZ6o/JW2fAP4gL3srCsHwefyfxx4E6B9cLE5yCr+mj+GOz6sBNQel
Bc44BGSr3DASCisGAQQBl1UBBQEBB0Bh4Lq9FF4VIvJ9U3/wI3nDQ/0C3uNMjBai
1cQ85G3BLgMBCAfCeAQYFgoAIBYhBCKjzYm9/VFRuQ4xqO476XwECobOBQJkq9ww
AhsMAAoJEO476XwECobO5bcA/1sikRqGxLp+7JcvfydxcS42NB/SMez5sLWXgdou
StrZAP9qwQIpPUTroVOP7mAPqi3BJupItSztX0EWiDba5HnIAQ==
=eYef
-----END PGP PUBLIC KEY BLOCK-----

View file

@ -1,4 +1,7 @@
_: {
imports = [
./terminal
];
home = {
username = "nezia";
homeDirectory = "/home/nezia";

View file

@ -1,5 +0,0 @@
_: {
imports = [
../common
];
}

View file

@ -1,5 +0,0 @@
_: {
imports = [
../common
];
}

10
home/profiles/default.nix Normal file
View file

@ -0,0 +1,10 @@
{
vamos = [
../.
./vamos
];
solaire = [
../.
./solaire
];
}

View file

@ -0,0 +1,13 @@
{
imports = [
../../programs/editors/neovim.nix
../../programs
../../programs/games
../../services/udiskie.nix
../../terminal/emulators/gnome-terminal.nix
../../terminal/emulators/wezterm.nix
];
}

View file

@ -0,0 +1,13 @@
{
imports = [
../../programs/editors/neovim.nix
../../programs
../../programs/gnome
../../services/udiskie.nix
../../terminal/emulators/gnome-terminal.nix
../../terminal/emulators/wezterm.nix
];
}

View file

@ -1,4 +1,8 @@
{pkgs, ...}: {
imports = [
./browsers.nix
];
programs.fzf.enable = true;
programs.fastfetch.enable = true;
home.packages = with pkgs; [

View file

@ -0,0 +1,120 @@
{
inputs,
pkgs,
lib,
...
}: {
imports = [inputs.nvf.homeManagerModules.default];
programs.nvf = {
enable = true;
settings.vim = {
viAlias = true;
vimAlias = true;
enableLuaLoader = true;
preventJunkFiles = true;
tabWidth = 4;
autoIndent = false;
useSystemClipboard = true;
luaConfigPost = lib.concatStrings [
''
vim.opt.formatoptions:remove('c')
vim.opt.formatoptions:remove('r')
vim.opt.formatoptions:remove('o')
''
];
maps = {
normal = {
"<leader>m" = {
silent = true;
action = "<cmd>make<CR>";
}; # Same as nnoremap <leader>m <silent> <cmd>make<CR>
"<leader>t" = {
silent = true;
action = "<cmd>Neotree toggle<CR>";
};
};
};
theme = {
enable = true;
name = "catppuccin";
style = "frappe";
};
visuals = {
enable = true;
nvimWebDevicons.enable = true;
};
ui = {
noice.enable = true;
};
notify.nvim-notify.enable = true;
statusline.lualine = {
enable = true;
theme = "catppuccin";
};
git.enable = true;
lsp = {
enable = true;
lspSignature.enable = true;
lspconfig.enable = true;
formatOnSave = true;
mappings = {
addWorkspaceFolder = "<leader>wa";
codeAction = "<leader>a";
goToDeclaration = "gD";
goToDefinition = "gd";
hover = "K";
listImplementations = "gi";
listReferences = "gr";
listWorkspaceFolders = "<leader>wl";
nextDiagnostic = "<leader>k";
previousDiagnostic = "<leader>j";
openDiagnosticFloat = "<leader>e";
removeWorkspaceFolder = "<leader>wr";
renameSymbol = "<leader>r";
signatureHelp = "<C-k>";
};
};
autocomplete = {
enable = true;
alwaysComplete = true;
};
autopairs.enable = true;
languages = {
enableExtraDiagnostics = true;
enableFormat = true;
enableLSP = true;
enableTreesitter = true;
nix.enable = true;
clang.enable = true;
python.enable = true;
};
treesitter = {
enable = true;
fold = true;
context.enable = true;
grammars = [
pkgs.vimPlugins.nvim-treesitter.builtGrammars.nix
pkgs.vimPlugins.nvim-treesitter.builtGrammars.c
pkgs.vimPlugins.nvim-treesitter.builtGrammars.python
];
};
binds.whichKey.enable = true;
filetree.neo-tree.enable = true;
telescope.enable = true;
};
};
}

View file

@ -0,0 +1,15 @@
{pkgs, ...}: {
home.packages = with pkgs; [
protonup-qt
bottles
lutris
path-of-building
r2modman
# steamtinkerlaunch dependencies
xdotool
xorg.xwininfo
yad
];
programs.mangohud.enable = true;
}

View file

@ -0,0 +1,60 @@
{
pkgs,
config,
...
}: {
dconf = {
enable = true;
settings = {
"org/gnome/shell" = {
disable-user-extensions = false; # enables user extensions
enabled-extensions = [
pkgs.gnomeExtensions.appindicator.extensionUuid
pkgs.gnomeExtensions.blur-my-shell.extensionUuid
pkgs.gnomeExtensions.emoji-copy.extensionUuid
pkgs.gnomeExtensions.clipboard-history.extensionUuid
];
};
"org/gnome/desktop/input-sources" = {
xkb-options = ["compose:ralt"];
};
"org/gnome/desktop/interface" = {
enable-hot-corners = false;
color-scheme = "prefer-dark";
};
"org/gnome/desktop/search-providers" = {
disabled = [
"org.gnome.Terminal.desktop"
"org.gnome.Software.desktop"
"org.gnome.seahorse.Application.desktop"
"org.gnome.clocks.desktop"
"org.gnome.Characters.desktop"
"org.gnome.Calendar.desktop"
"org.gnome.Calculator.desktop"
];
enabled = [
"org.gnome.Nautilus.desktop"
"org.gnome.Settings.desktop"
];
};
"org/freedesktop/tracker/mine/files" = {
index-recursive-directories = [
"&DESKTOP"
"&DOCUMENTS"
"&MUSIC"
"&PICTURES"
"&VIDEOS"
"${config.home.homeDirectory}/Notes"
"${config.home.homeDirectory}/Projects"
];
};
};
};
home.packages = with pkgs.gnomeExtensions; [
appindicator
blur-my-shell
clipboard-history
emoji-copy
];
}

View file

@ -0,0 +1,6 @@
{
imports = [
./programs
./shell
];
}

View file

@ -0,0 +1,15 @@
{
programs.gnome-terminal = {
enable = true;
showMenubar = false;
profile = {
"4621184a-b921-42cf-80a0-7784516606f2" = {
default = true;
audibleBell = false;
allowBold = true;
visibleName = "default";
font = "monospace 14";
};
};
};
}

View file

@ -0,0 +1,71 @@
_: {
programs.wezterm = {
enable = true;
# package = inputs.wezterm.packages.${pkgs.system}.default;
extraConfig = ''
local w = require('wezterm')
local function is_vim(pane)
return pane:get_user_vars().IS_NVIM == 'true'
end
local direction_keys = {
h = 'Left',
j = 'Down',
k = 'Up',
l = 'Right',
}
local function split_nav(resize_or_move, key)
return {
key = key,
mods = resize_or_move == 'resize' and 'META' or 'CTRL',
action = w.action_callback(function(win, pane)
if is_vim(pane) then
win:perform_action({
SendKey = { key = key, mods = resize_or_move == 'resize' and 'META' or 'CTRL' },
}, pane)
else
if resize_or_move == 'resize' then
win:perform_action({ AdjustPaneSize = { direction_keys[key], 3 } }, pane)
else
win:perform_action({ ActivatePaneDirection = direction_keys[key] }, pane)
end
end
end),
}
end
return {
enable_wayland = false,
front_end = "WebGpu",
hide_tab_bar_if_only_one_tab = true,
show_new_tab_button_in_tab_bar = false,
harfbuzz_features = { "ss01", "ss03" },
leader = { key = " ", mods = "CTRL", timeout_milliseconds = 1000 },
keys = {
{
mods = "LEADER",
key = "-",
action = wezterm.action.SplitVertical { domain = "CurrentPaneDomain" }
},
{
mods = "LEADER",
key = "=",
action = wezterm.action.SplitHorizontal { domain = "CurrentPaneDomain" }
},
split_nav('move', 'h'),
split_nav('move', 'j'),
split_nav('move', 'k'),
split_nav('move', 'l'),
split_nav('resize', 'h'),
split_nav('resize', 'j'),
split_nav('resize', 'k'),
split_nav('resize', 'l'),
},
}
'';
};
}

View file

@ -0,0 +1,21 @@
{pkgs, ...}: {
imports = [
./git.nix
./gnupg.nix
./tmux.nix
./direnv.nix
./zellij.nix
];
home.packages = with pkgs; [
# archives
zip
unzip
unrar
# utils
fd
file
ripgrep
];
}

View file

@ -0,0 +1,8 @@
{
programs.gpg.enable = true;
services.gpg-agent = {
enable = true;
enableBashIntegration = true;
enableFishIntegration = true;
};
}

View file

@ -1,9 +1,7 @@
_: {
{
imports = [
./fish.nix
./starship.nix
./zoxide.nix
./direnv.nix
./zellij.nix
];
}

View file

@ -1,13 +0,0 @@
_: {
imports = [
./system
./syncthing
./sops.nix
];
modules = {
gnome.enable = true;
stylix.enable = true;
docker.enable = true;
pipewire.enable = true;
};
}

View file

@ -1,14 +0,0 @@
{
hostname,
username,
...
}: {
sops = {
defaultSopsFile = ../../secrets/secrets.yaml;
defaultSopsFormat = "yaml";
age.keyFile = "/home/${username}/.config/sops/age/keys.txt";
secrets."syncthing/${hostname}/key" = {};
secrets."syncthing/${hostname}/cert" = {};
};
}

View file

@ -1,51 +0,0 @@
{
config,
username,
hostname,
...
}: let
homeDir = "/home/${username}";
devices = import ./devices.nix;
otherDevices = builtins.removeAttrs devices [hostname];
in {
services = {
syncthing = {
enable = true;
user = "${username}";
dataDir = "${homeDir}/Documents";
configDir = "${homeDir}/.config/syncthing"; # Folder for Syncthing's settings and keys
key = "${config.sops.secrets."syncthing/${hostname}/key".path}";
cert = "${config.sops.secrets."syncthing/${hostname}/cert".path}";
settings = {
devices = otherDevices;
folders = {
"Documents" = {
path = "${homeDir}/Documents";
devices = builtins.attrNames otherDevices;
};
"Pictures" = {
path = "${homeDir}/Pictures";
devices = builtins.attrNames otherDevices;
};
"Music" = {
path = "${homeDir}/Music";
devices = builtins.attrNames otherDevices;
};
"Videos" = {
path = "${homeDir}/Videos";
devices = builtins.attrNames otherDevices;
};
"Projects" = {
path = "${homeDir}/Projects";
devices = builtins.attrNames otherDevices;
};
"Notes" = {
path = "${homeDir}/Notes";
devices = builtins.attrNames otherDevices;
};
};
};
};
};
systemd.services.syncthing.environment.STNODEFAULTFOLDER = "true"; # Don't create default ~/Sync folder
}

View file

@ -1,9 +0,0 @@
# TODO: add to sops directly instead of relying on another nix file
{
"vamos" = {
id = "UO6JWVU-MTLZGVQ-Z3QAFYH-6PW2QR6-SBOVM6P-S6JXR2S-A7VYAU2-RLRXEQY";
};
"solaire" = {
id = "R5RK7CH-DRFXW4E-ARTPMHN-UMWYQ4O-QK7F3TA-EHVLDK4-DQ6CBT4-XRRWQQM";
};
}

View file

@ -1,34 +0,0 @@
{hostname, ...}: {
networking.hostName = hostname;
networking.networkmanager.enable = true;
services = {
xserver.xkb = {
layout = "us";
variant = "";
};
# automount
udisks2.enable = true;
fwupd.enable = true;
};
users.users.nezia = {
isNormalUser = true;
description = "Anthony Rodriguez";
extraGroups = [
"networkmanager"
"wheel"
];
};
nixpkgs.config.allowUnfree = true;
hardware.enableAllFirmware = true;
system.stateVersion = "24.05";
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
}

View file

@ -1,11 +0,0 @@
_: {
imports = [
./core.nix
./boot.nix
./locale.nix
./packages.nix
./printing.nix
./misc.nix
./nh.nix
];
}

View file

@ -1,19 +0,0 @@
_: {
# Set your time zone.
time.timeZone = "Europe/Paris";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "fr_CH.UTF-8";
LC_IDENTIFICATION = "fr_CH.UTF-8";
LC_MEASUREMENT = "fr_CH.UTF-8";
LC_MONETARY = "fr_CH.UTF-8";
LC_NAME = "fr_CH.UTF-8";
LC_NUMERIC = "fr_CH.UTF-8";
LC_PAPER = "fr_CH.UTF-8";
LC_TELEPHONE = "fr_CH.UTF-8";
LC_TIME = "fr_CH.UTF-8";
};
}

View file

@ -1,11 +0,0 @@
_: {
# fix direnv integration with fish
environment.pathsToLink = ["/share/fish"];
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
services.flatpak.enable = true;
}

View file

@ -1,11 +0,0 @@
{username, ...}: {
programs.nh = {
enable = true;
clean.enable = true;
clean.extraArgs = "--keep-since 4d --keep 3";
};
environment.sessionVariables = {
FLAKE = "/home/${username}/.dotfiles";
};
}

View file

@ -1,11 +0,0 @@
{pkgs, ...}: {
environment.systemPackages = with pkgs; [
vim
git
wget
curl
tree
python3
lm_sensors
];
}

52
hosts/default.nix Normal file
View file

@ -0,0 +1,52 @@
{
self,
inputs,
...
}: {
flake.nixosConfigurations = let
inherit (inputs.nixpkgs.lib) nixosSystem;
homeImports = import "${self}/home/profiles";
mod = "${self}/system";
inherit (import mod) laptop desktop;
specialArgs = {inherit inputs self;};
in {
vamos = nixosSystem {
inherit specialArgs;
modules =
laptop
++ [
./vamos
"${mod}/programs/gnome.nix"
{
home-manager = {
users.nezia.imports = homeImports.vamos;
extraSpecialArgs = specialArgs;
};
}
inputs.nixos-hardware.nixosModules.framework-13-7040-amd
];
};
solaire = nixosSystem {
inherit specialArgs;
modules =
desktop
++ [
./solaire
"${mod}/programs/gnome.nix"
"${mod}/hardware/nvidia.nix"
{
home-manager = {
users.nezia.imports = homeImports.solaire;
extraSpecialArgs = specialArgs;
};
}
];
};
};
}

View file

@ -2,51 +2,6 @@
imports = [
./hardware-configuration.nix
];
hardware.uni-sync = {
enable = true;
devices = [
{
device_id = "VID:3314/PID:41218/SN:6243168001";
sync_rgb = true;
channels = [
{
mode = "Manual";
speed = 60;
}
{
mode = "Manual";
speed = 60;
}
{
mode = "Manual";
speed = 60;
}
{
mode = "Manual";
speed = 60;
}
];
}
];
};
systemd.services.uni-sync = {
enable = true;
serviceConfig = {
ExecStart = "${pkgs.uni-sync}/bin/uni-sync";
};
wantedBy = ["multi-user.target"];
};
modules = {
nvidia.enable = true;
gaming.enable = true;
pipewire = {
enable = true;
latencyFix.enable = true;
};
neovim.enable = true;
};
stylix.image = ../../wallpapers/lucy-edgerunners-wallpaper.jpg;
networking.hostName = "solaire";
environment.variables.FLAKE = "/home/nezia/.dotfiles";
}

View file

@ -1,27 +1,7 @@
{inputs, ...}: {
{...}: {
imports = [
./hardware-configuration.nix
inputs.nixos-hardware.nixosModules.framework-13-7040-amd
];
services = {
fprintd.enable = true;
power-profiles-daemon.enable = true;
keyd = {
enable = true;
keyboards = {
default = {
ids = ["*"];
settings = {
main = {
capslock = "overload(control, esc)";
};
};
};
};
};
};
modules = {
neovim.enable = true;
wezterm.enable = true;
};
networking.hostName = "vamos";
environment.variables.FLAKE = "/home/nezia/.dotfiles";
}

View file

@ -1,8 +0,0 @@
_: {
imports = [
./gui
./other
./services
./tui
];
}

View file

@ -1,6 +0,0 @@
_: {
imports = [
./gnome.nix
./wezterm.nix
];
}

View file

@ -1,915 +0,0 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
inherit (pkgs.stdenv.hostPlatform) isDarwin;
cfg = config.programs.floorp;
jsonFormat = pkgs.formats.json {};
floorpConfigPath =
if isDarwin
then "Library/Application Support/Floorp"
else "${config.home.homeDirectory}/.floorp";
profilesPath =
if isDarwin
then "${floorpConfigPath}/Profiles"
else floorpConfigPath;
# The extensions path shared by all profiles; will not be supported
# by future Floorp versions.
extensionPath = "extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}";
profiles =
flip mapAttrs' cfg.profiles (_: profile:
nameValuePair "Profile${toString profile.id}" {
Name = profile.name;
Path =
if isDarwin
then "Profiles/${profile.path}"
else profile.path;
IsRelative = 1;
Default =
if profile.isDefault
then 1
else 0;
})
// {
General = {StartWithLastProfile = 1;};
};
profilesIni = generators.toINI {} profiles;
userPrefValue = pref:
builtins.toJSON (
if isBool pref || isInt pref || isString pref
then pref
else builtins.toJSON pref
);
mkUserJs = prefs: extraPrefs: bookmarks: let
prefs' =
lib.optionalAttrs ([] != bookmarks) {
"browser.bookmarks.file" = toString (floorpBookmarksFile bookmarks);
"browser.places.importBookmarksHTML" = true;
}
// prefs;
in ''
// Generated by Home Manager.
${concatStrings (mapAttrsToList (name: value: ''
user_pref("${name}", ${userPrefValue value});
'')
prefs')}
${extraPrefs}
'';
mkContainersJson = containers: let
containerToIdentity = _: container: {
userContextId = container.id;
name = container.name;
icon = container.icon;
color = container.color;
public = true;
};
in ''
${builtins.toJSON {
version = 4;
lastUserContextId =
elemAt (mapAttrsToList (_: container: container.id) containers) 0;
identities = mapAttrsToList containerToIdentity containers;
}}
'';
floorpBookmarksFile = bookmarks: let
indent = level:
lib.concatStringsSep "" (map (lib.const " ") (lib.range 1 level));
bookmarkToHTML = indentLevel: bookmark: ''
${indent indentLevel}<DT><A HREF="${
escapeXML bookmark.url
}" ADD_DATE="1" LAST_MODIFIED="1"${
lib.optionalString (bookmark.keyword != null)
" SHORTCUTURL=\"${escapeXML bookmark.keyword}\""
}${
lib.optionalString (bookmark.tags != [])
" TAGS=\"${escapeXML (concatStringsSep "," bookmark.tags)}\""
}>${escapeXML bookmark.name}</A>'';
directoryToHTML = indentLevel: directory: ''
${indent indentLevel}<DT>${
if directory.toolbar
then ''
<H3 ADD_DATE="1" LAST_MODIFIED="1" PERSONAL_TOOLBAR_FOLDER="true">Bookmarks Toolbar''
else ''<H3 ADD_DATE="1" LAST_MODIFIED="1">${escapeXML directory.name}''
}</H3>
${indent indentLevel}<DL><p>
${allItemsToHTML (indentLevel + 1) directory.bookmarks}
${indent indentLevel}</DL><p>'';
itemToHTMLOrRecurse = indentLevel: item:
if item ? "url"
then bookmarkToHTML indentLevel item
else directoryToHTML indentLevel item;
allItemsToHTML = indentLevel: bookmarks:
lib.concatStringsSep "\n"
(map (itemToHTMLOrRecurse indentLevel) bookmarks);
bookmarkEntries = allItemsToHTML 1 bookmarks;
in
pkgs.writeText "floorp-bookmarks.html" ''
<!DOCTYPE NETSCAPE-Bookmark-file-1>
<!-- This is an automatically generated file.
It will be read and overwritten.
DO NOT EDIT! -->
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks Menu</H1>
<DL><p>
${bookmarkEntries}
</DL>
'';
mkNoDuplicateAssertion = entities: entityKind: (let
# Return an attribute set with entity IDs as keys and a list of
# entity names with corresponding ID as value. An ID is present in
# the result only if more than one entity has it. The argument
# entities is a list of AttrSet of one id/name pair.
findDuplicateIds = entities:
filterAttrs (_entityId: entityNames: length entityNames != 1)
(zipAttrs entities);
duplicates = findDuplicateIds (mapAttrsToList
(entityName: entity: {"${toString entity.id}" = entityName;})
entities);
mkMsg = entityId: entityNames:
" - ID ${entityId} is used by " + concatStringsSep ", " entityNames;
in {
assertion = duplicates == {};
message =
''
Must not have a Floorp ${entityKind} with an existing ID but
''
+ concatStringsSep "\n" (mapAttrsToList mkMsg duplicates);
});
wrapPackage = package: let
# The configuration expected by the Floorp wrapper.
fcfg = {enableGnomeExtensions = cfg.enableGnomeExtensions;};
# A bit of hackery to force a config into the wrapper.
browserName =
package.browserName or (builtins.parseDrvName package.name).name;
# The configuration expected by the Floorp wrapper builder.
bcfg = setAttrByPath [browserName] fcfg;
in
if package == null
then null
else if isDarwin
then package
else if versionAtLeast config.home.stateVersion "19.09"
then
package.override (old: {
cfg = old.cfg or {} // fcfg;
extraPolicies = cfg.policies;
})
else (pkgs.wrapFloorp.override {config = bcfg;}) package {};
in {
meta.maintainers = [maintainers.rycee maintainers.kira-bruneau];
imports = [
(mkRemovedOptionModule ["programs" "floorp" "extensions"] ''
Extensions are now managed per-profile. That is, change from
programs.floorp.extensions = [ foo bar ];
to
programs.floorp.profiles.myprofile.extensions = [ foo bar ];'')
(mkRemovedOptionModule ["programs" "floorp" "enableAdobeFlash"]
"Support for this option has been removed.")
(mkRemovedOptionModule ["programs" "floorp" "enableGoogleTalk"]
"Support for this option has been removed.")
(mkRemovedOptionModule ["programs" "floorp" "enableIcedTea"]
"Support for this option has been removed.")
];
options = {
programs.floorp = {
enable = mkEnableOption "Floorp";
package = mkOption {
type = with types; nullOr package;
default =
if versionAtLeast config.home.stateVersion "19.09"
then pkgs.floorp
else pkgs.floorp-unwrapped;
defaultText = literalExpression "pkgs.floorp";
example = literalExpression ''
pkgs.floorp.override {
# See nixpkgs' floorp/wrapper.nix to check which options you can use
nativeMessagingHosts = [
# Gnome shell native connector
pkgs.gnome-browser-connector
# Tridactyl native connector
pkgs.tridactyl-native
];
}
'';
description = ''
The Floorp package to use. If state version 19.09 then
this should be a wrapped Floorp package. For earlier state
versions it should be an unwrapped Floorp package.
Set to `null` to disable installing Floorp.
'';
};
finalPackage = mkOption {
type = with types; nullOr package;
readOnly = true;
description = "Resulting Floorp package.";
};
policies = mkOption {
type = types.attrsOf jsonFormat.type;
default = {};
description = "[See list of policies](https://mozilla.github.io/policy-templates/).";
example = {
DefaultDownloadDirectory = "\${home}/Downloads";
BlockAboutConfig = true;
};
};
profiles = mkOption {
type = types.attrsOf (types.submodule ({
config,
name,
...
}: {
options = {
name = mkOption {
type = types.str;
default = name;
description = "Profile name.";
};
id = mkOption {
type = types.ints.unsigned;
default = 0;
description = ''
Profile ID. This should be set to a unique number per profile.
'';
};
settings = mkOption {
type = types.attrsOf (jsonFormat.type
// {
description = "Floorp preference (int, bool, string, and also attrs, list, float as a JSON string)";
});
default = {};
example = literalExpression ''
{
"browser.startup.homepage" = "https://nixos.org";
"browser.search.region" = "GB";
"browser.search.isUS" = false;
"distribution.searchplugins.defaultLocale" = "en-GB";
"general.useragent.locale" = "en-GB";
"browser.bookmarks.showMobileBookmarks" = true;
"browser.newtabpage.pinned" = [{
title = "NixOS";
url = "https://nixos.org";
}];
}
'';
description = ''
Attribute set of Floorp preferences.
Floorp only supports int, bool, and string types for
preferences, but home-manager will automatically
convert all other JSON-compatible values into strings.
'';
};
extraConfig = mkOption {
type = types.lines;
default = "";
description = ''
Extra preferences to add to {file}`user.js`.
'';
};
userChrome = mkOption {
type = types.lines;
default = "";
description = "Custom Floorp user chrome CSS.";
example = ''
/* Hide tab bar in FF Quantum */
@-moz-document url("chrome://browser/content/browser.xul") {
#TabsToolbar {
visibility: collapse !important;
margin-bottom: 21px !important;
}
#sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"] #sidebar-header {
visibility: collapse !important;
}
}
'';
};
userContent = mkOption {
type = types.lines;
default = "";
description = "Custom Floorp user content CSS.";
example = ''
/* Hide scrollbar in FF Quantum */
*{scrollbar-width:none !important}
'';
};
bookmarks = mkOption {
type = let
bookmarkSubmodule =
types.submodule ({
config,
name,
...
}: {
options = {
name = mkOption {
type = types.str;
default = name;
description = "Bookmark name.";
};
tags = mkOption {
type = types.listOf types.str;
default = [];
description = "Bookmark tags.";
};
keyword = mkOption {
type = types.nullOr types.str;
default = null;
description = "Bookmark search keyword.";
};
url = mkOption {
type = types.str;
description = "Bookmark url, use %s for search terms.";
};
};
})
// {
description = "bookmark submodule";
};
bookmarkType = types.addCheck bookmarkSubmodule (x: x ? "url");
directoryType =
types.submodule ({
config,
name,
...
}: {
options = {
name = mkOption {
type = types.str;
default = name;
description = "Directory name.";
};
bookmarks = mkOption {
type = types.listOf nodeType;
default = [];
description = "Bookmarks within directory.";
};
toolbar = mkOption {
type = types.bool;
default = false;
description = ''
Make this the toolbar directory. Note, this does _not_
mean that this directory will be added to the toolbar,
this directory _is_ the toolbar.
'';
};
};
})
// {
description = "directory submodule";
};
nodeType = types.either bookmarkType directoryType;
in
with types;
coercedTo (attrsOf nodeType) attrValues (listOf nodeType);
default = [];
example = literalExpression ''
[
{
name = "wikipedia";
tags = [ "wiki" ];
keyword = "wiki";
url = "https://en.wikipedia.org/wiki/Special:Search?search=%s&go=Go";
}
{
name = "kernel.org";
url = "https://www.kernel.org";
}
{
name = "Nix sites";
toolbar = true;
bookmarks = [
{
name = "homepage";
url = "https://nixos.org/";
}
{
name = "wiki";
tags = [ "wiki" "nix" ];
url = "https://nixos.wiki/";
}
];
}
]
'';
description = ''
Preloaded bookmarks. Note, this may silently overwrite any
previously existing bookmarks!
'';
};
path = mkOption {
type = types.str;
default = name;
description = "Profile path.";
};
isDefault = mkOption {
type = types.bool;
default = config.id == 0;
defaultText = "true if profile ID is 0";
description = "Whether this is a default profile.";
};
search = {
force = mkOption {
type = with types; bool;
default = false;
description = ''
Whether to force replace the existing search
configuration. This is recommended since Floorp will
replace the symlink for the search configuration on every
launch, but note that you'll lose any existing
configuration by enabling this.
'';
};
default = mkOption {
type = with types; nullOr str;
default = null;
example = "DuckDuckGo";
description = ''
The default search engine used in the address bar and search bar.
'';
};
privateDefault = mkOption {
type = with types; nullOr str;
default = null;
example = "DuckDuckGo";
description = ''
The default search engine used in the Private Browsing.
'';
};
order = mkOption {
type = with types; uniq (listOf str);
default = [];
example = ["DuckDuckGo" "Google"];
description = ''
The order the search engines are listed in. Any engines
that aren't included in this list will be listed after
these in an unspecified order.
'';
};
engines = mkOption {
type = with types; attrsOf (attrsOf jsonFormat.type);
default = {};
example = literalExpression ''
{
"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://nixos.wiki/index.php?search={searchTerms}"; }];
iconUpdateURL = "https://nixos.wiki/favicon.png";
updateInterval = 24 * 60 * 60 * 1000; # every day
definedAliases = [ "@nw" ];
};
"Bing".metaData.hidden = true;
"Google".metaData.alias = "@g"; # builtin engines only support specifying one additional alias
}
'';
description = ''
Attribute set of search engine configurations. Engines
that only have {var}`metaData` specified will
be treated as builtin to Floorp.
See [SearchEngine.jsm](https://searchfox.org/mozilla-central/rev/669329e284f8e8e2bb28090617192ca9b4ef3380/toolkit/components/search/SearchEngine.jsm#1138-1177)
in Floorp's source for available options. We maintain a
mapping to let you specify all options in the referenced
link without underscores, but it may fall out of date with
future options.
Note, {var}`icon` is also a special option
added by Home Manager to make it convenient to specify
absolute icon paths.
'';
};
};
containers = mkOption {
type = types.attrsOf (types.submodule ({name, ...}: {
options = {
name = mkOption {
type = types.str;
default = name;
description = "Container name, e.g., shopping.";
};
id = mkOption {
type = types.ints.unsigned;
default = 0;
description = ''
Container ID. This should be set to a unique number per container in this profile.
'';
};
# List of colors at
# https://searchfox.org/mozilla-central/rev/5ad226c7379b0564c76dc3b54b44985356f94c5a/toolkit/components/extensions/parent/ext-contextualIdentities.js#32
color = mkOption {
type = types.enum [
"blue"
"turquoise"
"green"
"yellow"
"orange"
"red"
"pink"
"purple"
"toolbar"
];
default = "pink";
description = "Container color.";
};
icon = mkOption {
type = types.enum [
"briefcase"
"cart"
"circle"
"dollar"
"fence"
"fingerprint"
"gift"
"vacation"
"food"
"fruit"
"pet"
"tree"
"chill"
];
default = "fruit";
description = "Container icon.";
};
};
}));
default = {};
example = {
"shopping" = {
id = 1;
color = "blue";
icon = "cart";
};
"dangerous" = {
id = 2;
color = "red";
icon = "fruit";
};
};
description = ''
Attribute set of container configurations. See
[Multi-Account
Containers](https://support.mozilla.org/en-US/kb/containers)
for more information.
'';
};
extensions = mkOption {
type = types.listOf types.package;
default = [];
example = literalExpression ''
with pkgs.nur.repos.rycee.floorp-addons; [
privacy-badger
]
'';
description = ''
List of Floorp add-on packages to install for this profile.
Some pre-packaged add-ons are accessible from the
[Nix User Repository](https://github.com/nix-community/NUR).
Once you have NUR installed run
```console
$ nix-env -f '<nixpkgs>' -qaP -A nur.repos.rycee.floorp-addons
```
to list the available Floorp add-ons.
Note that it is necessary to manually enable these extensions
inside Floorp after the first installation.
'';
};
};
}));
default = {};
description = "Attribute set of Floorp profiles.";
};
enableGnomeExtensions = mkOption {
type = types.bool;
default = false;
description = ''
Whether to enable the GNOME Shell native host connector. Note, you
also need to set the NixOS option
`services.gnome.gnome-browser-connector.enable` to
`true`.
'';
};
};
};
config = mkIf cfg.enable {
assertions =
[
(let
defaults =
catAttrs "name" (filter (a: a.isDefault) (attrValues cfg.profiles));
in {
assertion = cfg.profiles == {} || length defaults == 1;
message =
"Must have exactly one default Floorp profile but found "
+ toString (length defaults)
+ optionalString (length defaults > 1)
(", namely " + concatStringsSep ", " defaults);
})
(mkNoDuplicateAssertion cfg.profiles "profile")
]
++ (mapAttrsToList
(_: profile: mkNoDuplicateAssertion profile.containers "container")
cfg.profiles);
warnings = optional (cfg.enableGnomeExtensions or false) ''
Using 'programs.floorp.enableGnomeExtensions' has been deprecated and
will be removed in the future. Please change to overriding the package
configuration using 'programs.floorp.package' instead. You can refer to
its example for how to do this.
'';
programs.floorp.finalPackage = wrapPackage cfg.package;
home.packages = lib.optional (cfg.finalPackage != null) cfg.finalPackage;
home.file = mkMerge ([
{
"${floorpConfigPath}/profiles.ini" =
mkIf (cfg.profiles != {}) {text = profilesIni;};
}
]
++ flip mapAttrsToList cfg.profiles (_: profile: {
"${profilesPath}/${profile.path}/.keep".text = "";
"${profilesPath}/${profile.path}/chrome/userChrome.css" =
mkIf (profile.userChrome != "") {text = profile.userChrome;};
"${profilesPath}/${profile.path}/chrome/userContent.css" =
mkIf (profile.userContent != "") {text = profile.userContent;};
"${profilesPath}/${profile.path}/user.js" = mkIf (profile.settings
!= {}
|| profile.extraConfig != ""
|| profile.bookmarks != []) {
text =
mkUserJs profile.settings profile.extraConfig profile.bookmarks;
};
"${profilesPath}/${profile.path}/containers.json" = mkIf (profile.containers != {}) {
text = mkContainersJson profile.containers;
};
"${profilesPath}/${profile.path}/search.json.mozlz4" =
mkIf
(profile.search.default
!= null
|| profile.search.privateDefault != null
|| profile.search.order != []
|| profile.search.engines != {}) {
force = profile.search.force;
source = let
settings = {
version = 6;
engines = let
# Map of nice field names to internal field names.
# This is intended to be exhaustive and should be
# updated at every version bump.
internalFieldNames =
(genAttrs [
"name"
"isAppProvided"
"loadPath"
"hasPreferredIcon"
"updateInterval"
"updateURL"
"iconUpdateURL"
"iconURL"
"iconMapObj"
"metaData"
"orderHint"
"definedAliases"
"urls"
] (name: "_${name}"))
// {
searchForm = "__searchForm";
};
processCustomEngineInput = input:
(removeAttrs input ["icon"])
// optionalAttrs (input ? icon) {
# Convenience to specify absolute path to icon
iconURL = "file://${input.icon}";
}
// (optionalAttrs (input ? iconUpdateURL) {
# Convenience to default iconURL to iconUpdateURL so
# the icon is immediately downloaded from the URL
iconURL = input.iconURL or input.iconUpdateURL;
}
// {
# Required for custom engine configurations, loadPaths
# are unique identifiers that are generally formatted
# like: [source]/path/to/engine.xml
loadPath = ''
[home-manager]/programs.floorp.profiles.${profile.name}.search.engines."${
replaceStrings ["\\"] ["\\\\"] input.name
}"'';
});
processEngineInput = name: input: let
requiredInput = {
inherit name;
isAppProvided =
input.isAppProvided or removeAttrs input
["metaData"]
== {};
metaData = input.metaData or {};
};
in
if requiredInput.isAppProvided
then requiredInput
else processCustomEngineInput (input // requiredInput);
buildEngineConfig = name: input:
mapAttrs' (name: value: {
name = internalFieldNames.${name} or name;
inherit value;
}) (processEngineInput name input);
sortEngineConfigs = configs: let
buildEngineConfigWithOrder = order: name: let
config =
configs.${name}
or {
_name = name;
_isAppProvided = true;
_metaData = {};
};
in
config
// {
_metaData = config._metaData // {inherit order;};
};
engineConfigsWithoutOrder =
attrValues (removeAttrs configs profile.search.order);
sortedEngineConfigs =
(imap buildEngineConfigWithOrder profile.search.order)
++ engineConfigsWithoutOrder;
in
sortedEngineConfigs;
engineInput =
profile.search.engines
// {
# Infer profile.search.default as an app provided
# engine if it's not in profile.search.engines
${profile.search.default} =
profile.search.engines.${profile.search.default} or {};
}
// {
${profile.search.privateDefault} =
profile.search.engines.${profile.search.privateDefault} or {};
};
in
sortEngineConfigs (mapAttrs buildEngineConfig engineInput);
metaData =
optionalAttrs (profile.search.default != null) {
current = profile.search.default;
hash = "@hash@";
}
// optionalAttrs (profile.search.privateDefault != null) {
private = profile.search.privateDefault;
privateHash = "@privateHash@";
}
// {
useSavedOrder = profile.search.order != [];
};
};
# Home Manager doesn't circumvent user consent and isn't acting
# maliciously. We're modifying the search outside of Floorp, but
# a claim by Mozilla to remove this would be very anti-user, and
# is unlikely to be an issue for our use case.
disclaimer = appName:
"By modifying this file, I agree that I am doing so "
+ "only within ${appName} itself, using official, user-driven search "
+ "engine selection processes, and in a way which does not circumvent "
+ "user consent. I acknowledge that any attempt to change this file "
+ "from outside of ${appName} is a malicious act, and will be responded "
+ "to accordingly.";
salt =
if profile.search.default != null
then profile.path + profile.search.default + disclaimer "Floorp"
else null;
privateSalt =
if profile.search.privateDefault != null
then
profile.path
+ profile.search.privateDefault
+ disclaimer "Floorp"
else null;
in
pkgs.runCommand "search.json.mozlz4" {
nativeBuildInputs = with pkgs; [mozlz4a openssl];
json = builtins.toJSON settings;
inherit salt privateSalt;
} ''
if [[ -n $salt ]]; then
export hash=$(echo -n "$salt" | openssl dgst -sha256 -binary | base64)
export privateHash=$(echo -n "$privateSalt" | openssl dgst -sha256 -binary | base64)
mozlz4a <(substituteStream json search.json.in --subst-var hash --subst-var privateHash) "$out"
else
mozlz4a <(echo "$json") "$out"
fi
'';
};
"${profilesPath}/${profile.path}/extensions" = mkIf (profile.extensions != []) {
source = let
extensionsEnvPkg = pkgs.buildEnv {
name = "hm-floorp-extensions";
paths = profile.extensions;
};
in "${extensionsEnvPkg}/share/mozilla/${extensionPath}";
recursive = true;
force = true;
};
}));
};
}

View file

@ -1,140 +0,0 @@
{
config,
lib,
pkgs,
username,
...
}: let
cfg = config.modules.gnome;
stylixEnabled = config.modules.stylix.enable or false;
in {
options = {
modules.gnome = {
enable = lib.mkEnableOption "Enable Gnome";
};
};
config = lib.mkIf cfg.enable {
services.xserver = {
enable = true;
displayManager.gdm.enable = true;
desktopManager.gnome = {
enable = true;
extraGSettingsOverridePackages = [pkgs.mutter];
extraGSettingsOverrides = ''
[org.gnome.mutter]
experimental-features=['scale-monitor-framebuffer']
'';
};
};
environment.gnome.excludePackages = with pkgs; [
gnome-console
gnome-photos
gnome-tour
gnome-software
iagno
hitori
atomix
gnome-contacts
gnome-initial-setup
gnome-music
gedit
cheese
tali
epiphany
geary
yelp
];
environment.systemPackages = with pkgs; [
gnome-tweaks
gnome-power-manager
rhythmbox
];
stylix = lib.mkIf stylixEnabled {
targets = {
plymouth.enable = false;
gtk.enable = false;
gnome.enable = false;
};
fonts = {
sansSerif = {
package = pkgs.inter;
name = "Intel Variable";
};
serif = config.stylix.fonts.sansSerif;
};
};
home-manager.users.${username} = {
stylix = lib.mkIf stylixEnabled {
targets.gtk.enable = false;
};
dconf = {
enable = true;
settings = {
"org/gnome/shell" = {
disable-user-extensions = false; # enables user extensions
enabled-extensions = [
pkgs.gnomeExtensions.appindicator.extensionUuid
pkgs.gnomeExtensions.blur-my-shell.extensionUuid
pkgs.gnomeExtensions.emoji-copy.extensionUuid
pkgs.gnomeExtensions.clipboard-history.extensionUuid
];
};
"org/gnome/desktop/input-sources" = {
xkb-options = ["compose:ralt"];
};
"org/gnome/desktop/interface" = {
enable-hot-corners = false;
};
"org/gnome/desktop/search-providers" = {
disabled = [
"org.gnome.Terminal.desktop"
"org.gnome.Software.desktop"
"org.gnome.seahorse.Application.desktop"
"org.gnome.clocks.desktop"
"org.gnome.Characters.desktop"
"org.gnome.Calendar.desktop"
"org.gnome.Calculator.desktop"
];
enabled = [
"org.gnome.Nautilus.desktop"
"org.gnome.Settings.desktop"
];
};
"org/freedesktop/tracker/mine/files" = {
index-recursive-directories = [
"&DESKTOP"
"&DOCUMENTS"
"&MUSIC"
"&PICTURES"
"&VIDEOS"
"/home/${username}/Notes"
"/home/${username}/Projects"
];
};
};
};
home.packages = with pkgs.gnomeExtensions; [
appindicator
blur-my-shell
clipboard-history
emoji-copy
];
programs.gnome-terminal = {
enable = true;
showMenubar = false;
profile = {
"4621184a-b921-42cf-80a0-7784516606f2" = {
default = true;
audibleBell = false;
allowBold = true;
visibleName = "${username}";
font = "IntoneMono NF 14";
};
};
};
};
};
}

View file

@ -1,87 +0,0 @@
{
config,
lib,
username,
...
}: let
cfg = config.modules.wezterm;
in {
options = {
modules.wezterm = {
enable = lib.mkEnableOption "enable wezterm";
};
};
config = lib.mkIf cfg.enable {
home-manager.users.${username} = {
programs.wezterm = {
enable = true;
# package = inputs.wezterm.packages.${pkgs.system}.default;
extraConfig = ''
local w = require('wezterm')
local function is_vim(pane)
return pane:get_user_vars().IS_NVIM == 'true'
end
local direction_keys = {
h = 'Left',
j = 'Down',
k = 'Up',
l = 'Right',
}
local function split_nav(resize_or_move, key)
return {
key = key,
mods = resize_or_move == 'resize' and 'META' or 'CTRL',
action = w.action_callback(function(win, pane)
if is_vim(pane) then
win:perform_action({
SendKey = { key = key, mods = resize_or_move == 'resize' and 'META' or 'CTRL' },
}, pane)
else
if resize_or_move == 'resize' then
win:perform_action({ AdjustPaneSize = { direction_keys[key], 3 } }, pane)
else
win:perform_action({ ActivatePaneDirection = direction_keys[key] }, pane)
end
end
end),
}
end
return {
enable_wayland = false,
front_end = "WebGpu",
hide_tab_bar_if_only_one_tab = true,
show_new_tab_button_in_tab_bar = false,
harfbuzz_features = { "ss01", "ss03" },
leader = { key = " ", mods = "CTRL", timeout_milliseconds = 1000 },
keys = {
{
mods = "LEADER",
key = "-",
action = wezterm.action.SplitVertical { domain = "CurrentPaneDomain" }
},
{
mods = "LEADER",
key = "=",
action = wezterm.action.SplitHorizontal { domain = "CurrentPaneDomain" }
},
split_nav('move', 'h'),
split_nav('move', 'j'),
split_nav('move', 'k'),
split_nav('move', 'l'),
split_nav('resize', 'h'),
split_nav('resize', 'j'),
split_nav('resize', 'k'),
split_nav('resize', 'l'),
},
}
'';
};
};
};
}

View file

@ -1,7 +0,0 @@
_: {
imports = [
./gaming.nix
./nvidia.nix
./stylix.nix
];
}

View file

@ -1,52 +0,0 @@
{
lib,
config,
pkgs,
username,
...
}: let
cfg = config.modules.gaming;
in {
options = {
modules.gaming = {
enable = lib.mkEnableOption "Enable the gaming module";
};
};
config = lib.mkIf cfg.enable {
programs = {
steam = {
enable = true;
gamescopeSession.enable = true;
};
gamemode.enable = true;
coolercontrol = {
enable = true;
nvidiaSupport = true;
};
};
hardware.keyboard.qmk.enable = true;
environment.systemPackages = with pkgs; [
via
];
services.udev.packages = [pkgs.via];
home-manager.users.${username} = {
home.packages = with pkgs; [
protonup-qt
bottles
lutris
path-of-building
r2modman
# steamtinkerlaunch dependencies
unzip
xdotool
xorg.xwininfo
yad
];
programs.mangohud.enable = true;
};
};
}

View file

@ -1,46 +0,0 @@
{
config,
lib,
...
}: let
cfg = config.modules.nvidia;
in {
options = {
modules.nvidia = {
enable = lib.mkEnableOption "Enable the Nvidia module";
};
};
config = lib.mkIf cfg.enable {
services.xserver.videoDrivers = ["nvidia"];
hardware.nvidia = {
# Modesetting is required.
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
# Enable this if you have graphical corruption issues or application crashes after waking
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
# of just the bare essentials.
powerManagement.enable = false;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = false;
# Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+
# Currently alpha-quality/buggy, so false is currently the recommended setting.
open = false;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.beta;
};
};
}

View file

@ -1,54 +0,0 @@
{
config,
lib,
pkgs,
...
}: let
cfg = config.modules.stylix;
in {
options = {
modules.stylix = {
enable = lib.mkEnableOption "Enable the stylix module";
};
};
config = lib.mkIf cfg.enable {
stylix = {
enable = true;
polarity = "dark";
base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-frappe.yaml";
cursor = {
package = pkgs.adwaita-icon-theme;
name = "Adwaita";
size = 24;
};
fonts = {
serif = lib.mkDefault {
package = pkgs.noto-fonts;
name = "Noto Serif";
};
sansSerif = lib.mkDefault {
package = pkgs.noto-fonts;
name = "Noto Sans";
};
monospace = lib.mkDefault {
package = pkgs.nerdfonts.override {fonts = ["IntelOneMono"];};
name = "IntoneMono Nerd Font";
};
emoji = {
package = pkgs.noto-fonts-color-emoji;
name = "Noto Color Emoji";
};
sizes = lib.mkDefault {
terminal = 14;
applications = 10;
desktop = 10;
};
};
targets = {
gtk.enable = false;
gnome.enable = false;
};
image = lib.mkDefault ../../wallpapers/nix-wallpaper-nineish-catppuccin-frappe-alt.svg;
};
};
}

View file

@ -1,6 +0,0 @@
_: {
imports = [
./docker.nix
./pipewire.nix
];
}

View file

@ -1,20 +0,0 @@
{
config,
lib,
username,
...
}: let
cfg = config.modules.docker;
in {
options.modules.docker.enable = lib.mkEnableOption "docker module";
config = lib.mkIf cfg.enable {
virtualisation.docker = {
enable = true;
rootless = {
enable = true;
setSocketVariable = true;
};
};
users.users.${username}.extraGroups = ["docker"];
};
}

View file

@ -1,32 +0,0 @@
{
config,
lib,
...
}: let
cfg = config.modules.pipewire;
in {
options.modules.pipewire.enable = lib.mkEnableOption "pipewire module";
options.modules.pipewire.latencyFix.enable = lib.mkEnableOption "enable latency fixes";
config = lib.mkIf cfg.enable {
hardware.pulseaudio.enable = false;
# rtkit is optional but recommended
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
};
services.pipewire.extraConfig.pipewire."92-low-latency" = lib.mkIf cfg.latencyFix.enable {
"context.properties" = {
"default.clock.rate" = 48000;
"default.clock.allowed-rates" = [48000];
"default.clock.quantum" = 2048;
"default.clock.min-quantum" = 1024;
};
};
};
}

View file

@ -1,5 +0,0 @@
_: {
imports = [
./neovim.nix
];
}

View file

@ -1,134 +0,0 @@
{
config,
inputs,
lib,
pkgs,
username,
...
}: let
cfg = config.modules.neovim;
in {
options.modules.neovim.enable = lib.mkEnableOption "neovim";
config = lib.mkIf cfg.enable {
environment.sessionVariables = {
EDITOR = "nvim";
};
home-manager.users.${username} = {
imports = [inputs.nvf.homeManagerModules.default];
programs.nvf = {
enable = true;
settings.vim = {
viAlias = true;
vimAlias = true;
enableLuaLoader = true;
preventJunkFiles = true;
tabWidth = 4;
autoIndent = false;
useSystemClipboard = true;
luaConfigPost = lib.concatStrings [
''
vim.opt.formatoptions:remove('c')
vim.opt.formatoptions:remove('r')
vim.opt.formatoptions:remove('o')
''
];
maps = {
normal = {
"<leader>m" = {
silent = true;
action = "<cmd>make<CR>";
}; # Same as nnoremap <leader>m <silent> <cmd>make<CR>
"<leader>t" = {
silent = true;
action = "<cmd>Neotree toggle<CR>";
};
};
};
theme = {
enable = true;
name = "catppuccin";
style = "frappe";
};
visuals = {
enable = true;
nvimWebDevicons.enable = true;
};
ui = {
noice.enable = true;
};
notify.nvim-notify.enable = true;
statusline.lualine = {
enable = true;
theme = "catppuccin";
};
git.enable = true;
lsp = {
enable = true;
lspSignature.enable = true;
lspconfig.enable = true;
formatOnSave = true;
mappings = {
addWorkspaceFolder = "<leader>wa";
codeAction = "<leader>a";
goToDeclaration = "gD";
goToDefinition = "gd";
hover = "K";
listImplementations = "gi";
listReferences = "gr";
listWorkspaceFolders = "<leader>wl";
nextDiagnostic = "<leader>k";
previousDiagnostic = "<leader>j";
openDiagnosticFloat = "<leader>e";
removeWorkspaceFolder = "<leader>wr";
renameSymbol = "<leader>r";
signatureHelp = "<C-k>";
};
};
autocomplete = {
enable = true;
alwaysComplete = true;
};
autopairs.enable = true;
languages = {
enableExtraDiagnostics = true;
enableFormat = true;
enableLSP = true;
enableTreesitter = true;
nix.enable = true;
clang.enable = true;
python.enable = true;
};
treesitter = {
enable = true;
fold = true;
context.enable = true;
grammars = [
pkgs.vimPlugins.nvim-treesitter.builtGrammars.nix
pkgs.vimPlugins.nvim-treesitter.builtGrammars.c
pkgs.vimPlugins.nvim-treesitter.builtGrammars.python
];
};
binds.whichKey.enable = true;
filetree.neo-tree.enable = true;
telescope.enable = true;
};
};
};
};
}

View file

@ -1,29 +0,0 @@
syncthing:
vamos:
key: ENC[AES256_GCM,data:scXcpelnAZdiGXDNhvLSuNKa9qVjBvmQtvYnuwK+WUobIPFCI5vQcj1xtgmBhb9+tLdOSj5vPjvXeR8m5iwAcm/GShAHgBOiR3eyLuUaOhKAcbQZ3Ev1YdaVH/znwVmYoOdE1QcEKflnfRUNftswu0cJrfeEdpEAMrEUWWip95ejbXIawxtX0jWsKaY7//8niogsU6LjR1pfjOR3zC2CzTtztyAmsiUj7KV4CR3AMSW6NYsHVxOB2CsrUBYCOvrgRKf5IOLC6UzN9y8nefnW/RzR5DOQgOeHpUCMqtVPgtIRFKI1uhr7Yv+vy/9jNDg4zi/+2FkDqSDu68sucgq2yMSQCa6Amv1WT40HYniiyVn+N5x1j2SfSnynrwoZFyK9,iv:6l/BJMkqK3sPkLllbp1hPQ2hcq34UGBYEwIYBFgXkWg=,tag:R06GXVQuBzNsH5SMZ/VY+w==,type:str]
cert: ENC[AES256_GCM,data:Nr1eE/6Mn1Migsl6whqr9iTuVCFoikQJB8QUFH85YKS+KphiXadKB/xwxhYqeuartDsdPusclsX5mjgoxmQwnwXyJLVJyVo3owXgFxhWd1OP3x2O1kIZ/4lbCDjDiGO5yASnkchvQyF6h/K+p+rZrGnfFtAiInZSaBTUUW8hlqRjh4DmNVh5ViVckquZMIZCWHMIchjiaoeW7twhSCuX5Oo72utsp6am1dBhWAlzXKeRdEBy9iwxC/fuOfS28rdOk9l5RQsoAaE5vaAV/IS2O0qi90ec0x+Rtta98thZKjXXW4nkjYDa3BLD5Xq89rl9W0D/HouWeE3eOOkka5kpp6hW1QvrL6vf8egwc//KqUssbwGXvKBri8fgFqVCwJMW38czAYz6rGNhieS23bP8BK4DFPbbRXkjFzDp1HyJEwyRRLvQmB/1+SY+spQpKFDn5QPvPvSHn2qRIZTU72jsEXw3IG1setTbwp289saxlT2Wu185rkfH/HlWpO8jFH3/Hap776cZ81fhDO2A2Giz1B276TFhftiAqxhmR59UKUyhwG4MHJqgaN23oVQhSbuGVEVXEcsopuc7vmZHUw2PB3F2UtsaxpP68Cprto9/oo3dkNbYl4KInHCFzXkKn5GzkSDAtsWD62OR0Qe3xeAG9Aunxg8gGLPTn5xzO99aS+jwcM5aaDRkzJ0qc/+7Mu74n8PQZUYDr73eDIPxv9Xh9uLw/AhqggmI/GcxynvsQQjcziGThchJz5OX+crGlf6ZpWETC44SDvaE/6RKS5VDy2hDGAb5q8jiQGp5PEQL+J4UR6ZsdTH7NWE+BGCQGH26ew+70+RjdLlDFtOolc5hFxRrB6FeLOPkP3VrmkkgJE3MaOfwDx8lJ6uETjfSxwGhxExx37giD7NICd1Vs+8Rfhz/P8V6DW5TIV9rziGlY8QbamaczDyhclntu39p0548Zbe9Ya8OGgxT62d7pLYn2Oz9debgU1BavBuYciOQvCZlqCqNRXNKVHLJRAprIyHFpHnKbSUbHTRXVm2ZE9uSeseMPMRILG3sYwA=,iv:FrCt2uSPQ5oXk+5FwA6S+mpHfoWky4ellvUtx6gxYLk=,tag:u9riwtZjP3v9Vsbb0ZIdQg==,type:str]
deviceId: ENC[AES256_GCM,data:mxnto9RbgeB5OvxfpK2Hlr8y3SrpgvVQ8GMPjD5h/QmS8anyI3ewL1ZlnBXUQAqAQkcTWKu0BWBv1bfnqpPS,iv:7D7MSbRxwspl7n4biK0DYRIKoedt2aCc2xrFaHSo2Zk=,tag:4LarA7Aq4+QwuJF5HVaBaw==,type:str]
solaire:
key: ENC[AES256_GCM,data:XB0OcDl98l0AoQVJJjy7RCAQEfXg2eOVYVdKm1AmROxfXqvCfCsdEPdFcq/C6GeDZZMG3pYOapF1fWG2uD7yqpKH2vzlL9yhv/hm7nbyhDCYeBtu8PGHVz8LR04xJZzON1nd+Y9lztAcvBhy0td8pey2YBlC718tGvR7AaKIULrFVA7xj8VdlPpR5ASvLmI6TFuDEyqUsDtNkpcI5BhWpj4y49qpWID0uMi52Tw8bXYn1XOdITYI4ncJawCDE+VEVUYehe9U92eISMNKyV7SPzq7DNdKSpzObVlt971rhqN9SAjnilRRMDAlWuQ/M5t/4bmZTPehry+2xEBMWdv+2GbdgcEmtisxV9TQYHROAJq3okUlfKX5gvyU3VMFeukB,iv:+HShUZ2KdPEUT4dQda/kt9L320G/e1Qfbch6qu5oIM4=,tag:MClNH/PoSQ4SYQ5ecwkyCg==,type:str]
cert: ENC[AES256_GCM,data:UpwKCK602rEkDvSQHnKjipd3vvKsBnWO4k2r+L+dvhVsiGQvDYu2Dt0BQ8/RXBv9Vl9aQwu2ZCDnCztxLizjWpUjELVaf2+tAIJc/NUGBzCRLTxYVKL98vYDvg3r+JXlceK2S9jWr1CSzh/uqXLYsWLvE+gG8WjUtBxbVoyS9/MMf9hLxXZlhjR5mMKuCyeFk7aNA8su2rnm7lX/4IfgUQu9u28Eu8NswfnuycCxv560fqGHnyniID6/PQ7ME9g4Ldn5H6SQLeBF7d70kbVjwNlcBm0uRbFdaQEpFt02JrcTZN1DxXCaeOkkC15v/ShqKL0XGFxhwDiOQ9iKP6GWWWDZMMgyILFE3g3Td9M5fOFt5fmI/i8+/Jw64p2IK7A1I97Pm+Q9rU2uc4wrq0xXOYhMM/ljrg7PUZtFeixL+PdAuVtdGBtKVhH3r49TpCqSqMNfxri2SMiB+Aoc5w6zkGjTImqdWXoy9hlaI/kFk+8xMFIE3xIT+kv3RLqtQFHWeMM8PmjGoJkgw90mZ06A/b2iZ5GtPukKKMxCqDV5P21K/ExBVe2qMB+BsLsWoXHxkFDdFv/eHfpKfpPW5ZlK3/RAmw/Pf5AJj5W/J3qhX1/qmM9CMcGjyhOhplacONb76BoZfkpaycufnr6f+U+3NlxUJ07XRG00J66qxBs/n+NNAdtvuwYGkakGhbpZJq3BkXSovzlJQ32nKN0CkM/xTxsPj0xDn8Ff+NVt/3EDYlz5rff6qm7YZPB0LwZy18eypfeRtYhINx4bN6sKkIxLFOrcabW0T1Snq22UtfKlq7D2LUVgOOXXsaHmm1Dv1ysMM2Vy/lIYipzSL8J8sXKiVeTHbnDJ8PZshbKOwFC40QMk6UCcjvzW1kFwgqixVMnh/qJtBfApC+Tt9dwKtWwLernWmb2nCn1R+jnDfl905oHa4gMxZk4V3gsXtgoxGV2rw9Upbvp7bZjcp9yRgppnZvvm4/3AjccVbtaZPQlRMIMxDtF2FaJO4xn14tKs+F+ezri6jQBnuMk43FdugS/RfoZzgHYxrZ6o4D4=,iv:LzOUhtGQqvDYz2d3odQl79NISW0R5yHdnGnyCKtZClQ=,tag:3s+hvTZ2LR0O3PmcCH/Y6A==,type:str]
deviceId: ENC[AES256_GCM,data:Esj/3kZyg2HRP8h2RGv7/52TT2kAyOYN/LG3itRF51u6BagSKtmONmdJqmQ0GaXRHJIWAu/vCiP4u8h2OFmt,iv:G7r53MRmahA6x1sgLWZ3jBQ8pN0A3x9RR8QhD+++H9E=,tag:GPr7Vl2QQjlsxvKm2jpwig==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age:
- recipient: age1mvdgtkaz4ttp8cp9uf7en22fs06xl7823sjpudw6yw8525ykeews9c5x34
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBPT0RJNGdCcHh0U1FIL2Zv
OStzbEYzV2ZvZWpuRVJTMG5LSzZFcExJWUdNCjN6K1BFdWpyNElUWmpQc08wRkd3
VzRJWHlicmxBellXaVl6N3pZZDJMa2sKLS0tIHpSTmRIbGlSWUJQNjZZLytuaUNz
cWRVSWR1TDFOaVhDbDhzQnNnaS80Vm8Kd8DzT7uRneMOVngA3XC/WIbhaSNzWbCQ
KwngtMhFTh+hvLKUYkA189La4TfXKfjmcGF6/vxwZ9N5vHLQ9cm5Nw==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-08-25T20:35:09Z"
mac: ENC[AES256_GCM,data:5iyIoWNMXonK5RuTyMjgbFqzSuYM3aZdN0TABQ4ETkP6nOQ15k8xRxz5vah4OPK5hY7Qp3ZBIK0D/Qb0lgsg7TmaMkPkCdKyFL2DYxFxKIzZhbbZ62Gy3uQ4xOBXgEHWQ6RmMnIxFdytROO/7ValdnSUdEXWVvLoBMjh59IgrIU=,iv:/KR5YdMdjxD8h7+IWMsQFhVpnsqc4WoNeN8RnqmV6pA=,tag:RiJ+/Suu1UINZzIk9WK3Zg==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.9.0

25
system/core/default.nix Normal file
View file

@ -0,0 +1,25 @@
{lib, ...}: {
imports = [
./boot.nix
./users.nix
../nix
];
i18n = {
defaultLocale = "en_US.UTF-8";
extraLocaleSettings = {
LC_ADDRESS = "fr_CH.UTF-8";
LC_IDENTIFICATION = "fr_CH.UTF-8";
LC_MEASUREMENT = "fr_CH.UTF-8";
LC_MONETARY = "fr_CH.UTF-8";
LC_NAME = "fr_CH.UTF-8";
LC_NUMERIC = "fr_CH.UTF-8";
LC_PAPER = "fr_CH.UTF-8";
LC_TELEPHONE = "fr_CH.UTF-8";
LC_TIME = "fr_CH.UTF-8";
};
};
system.stateVersion = lib.mkDefault "24.05";
time.timeZone = lib.mkDefault "Europe/Paris";
zramSwap.enable = true;
}

10
system/core/users.nix Normal file
View file

@ -0,0 +1,10 @@
{...}: {
users.users.nezia = {
isNormalUser = true;
description = "Anthony Rodriguez";
extraGroups = [
"networkmanager"
"wheel"
];
};
}

28
system/default.nix Normal file
View file

@ -0,0 +1,28 @@
let
common = [
./core
./hardware/printing.nix
./hardware/fwupd.nix
./network
./programs
./services
];
desktop =
common
++ [
./hardware/uni-sync.nix
];
laptop =
desktop
++ [
./hardware/power.nix
./hardware/fprintd.nix
./services/keyd.nix
];
in {
inherit desktop laptop;
}

View file

@ -0,0 +1,3 @@
{
services.fprintd.enable = true;
}

View file

@ -0,0 +1,3 @@
{
services.fwupd.enable = true;
}

View file

@ -0,0 +1,33 @@
{config, ...}: {
services.xserver.videoDrivers = ["nvidia"];
hardware.nvidia = {
# Modesetting is required.
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
# Enable this if you have graphical corruption issues or application crashes after waking
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
# of just the bare essentials.
powerManagement.enable = false;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = false;
# Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+
# Currently alpha-quality/buggy, so false is currently the recommended setting.
open = false;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.beta;
};
}

View file

@ -0,0 +1,3 @@
{
services.power-profiles-daemon.enable = true;
}

View file

@ -0,0 +1,37 @@
{pkgs, ...}: {
hardware.uni-sync = {
enable = true;
devices = [
{
device_id = "VID:3314/PID:41218/SN:6243168001";
sync_rgb = true;
channels = [
{
mode = "Manual";
speed = 60;
}
{
mode = "Manual";
speed = 60;
}
{
mode = "Manual";
speed = 60;
}
{
mode = "Manual";
speed = 60;
}
];
}
];
};
systemd.services.uni-sync = {
enable = true;
serviceConfig = {
ExecStart = "${pkgs.uni-sync}/bin/uni-sync";
};
wantedBy = ["multi-user.target"];
};
}

7
system/hardware/via.nix Normal file
View file

@ -0,0 +1,7 @@
{pkgs, ...}: {
hardware.keyboard.qmk.enable = true;
environment.systemPackages = with pkgs; [
via
];
services.udev.packages = [pkgs.via];
}

View file

@ -0,0 +1,13 @@
{
networking = {
networkmanager = {
enable = true;
dns = "systemd-resolved";
wifi.powersave = true;
};
};
services.resolved = {
enable = true;
dnsovertls = "opportunistic";
};
}

14
system/nix/default.nix Normal file
View file

@ -0,0 +1,14 @@
{pkgs, ...}: {
imports = [./nixpkgs.nix ./nh.nix];
environment.systemPackages = [pkgs.git];
nix = {
package = pkgs.lix;
settings = {
auto-optimise-store = true;
experimental-features = [
"nix-command"
"flakes"
];
};
};
}

9
system/nix/nh.nix Normal file
View file

@ -0,0 +1,9 @@
{
programs.nh = {
enable = true;
clean = {
enable = true;
extraArgs = "--keep-since 30d --keep 3";
};
};
}

3
system/nix/nixpkgs.nix Normal file
View file

@ -0,0 +1,3 @@
{
nixpkgs.config.allowUnfree = true;
}

View file

@ -0,0 +1,10 @@
{
imports = [
./fonts.nix
./home-manager.nix
];
programs = {
# make HM-managed GTK stuff work
dconf.enable = true;
};
}

21
system/programs/fonts.nix Normal file
View file

@ -0,0 +1,21 @@
{pkgs, ...}: {
fonts = {
packages = with pkgs; [
noto-fonts
noto-fonts-emoji
intel-one-mono
(nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];})
];
enableDefaultPackages = false;
fontconfig.defaultFonts = let
addAll = builtins.mapAttrs (_: v: ["Symbols Nerd Font"] ++ v ++ ["Noto Color Emoji"]);
in
addAll {
serif = ["Noto Serif"];
sansSerif = ["Inter"];
monospace = ["Intel One Mono"];
emoji = [];
};
};
}

View file

@ -0,0 +1,11 @@
{inputs, ...}: {
programs.gamemode = {
enable = true;
settings = {
general = {
softrealtime = "auto";
renice = 15;
};
};
};
}

16
system/programs/games.nix Normal file
View file

@ -0,0 +1,16 @@
{pkgs, ...}: {
programs = {
steam = {
enable = true;
gamescopeSession.enable = true;
extraCompatPackages = [
pkgs.proton-ge-bin
];
};
gamemode.enable = true;
coolercontrol = {
enable = true;
nvidiaSupport = true;
};
};
}

39
system/programs/gnome.nix Normal file
View file

@ -0,0 +1,39 @@
{pkgs, ...}: {
services.xserver = {
enable = true;
displayManager.gdm.enable = true;
desktopManager.gnome = {
enable = true;
extraGSettingsOverridePackages = [pkgs.mutter];
extraGSettingsOverrides = ''
[org.gnome.mutter]
experimental-features=['scale-monitor-framebuffer']
'';
};
};
environment.gnome.excludePackages = with pkgs; [
gnome-console
gnome-photos
gnome-tour
gnome-software
iagno
hitori
atomix
gnome-contacts
gnome-initial-setup
gnome-music
gedit
cheese
tali
epiphany
geary
yelp
];
environment.systemPackages = with pkgs; [
gnome-tweaks
gnome-power-manager
rhythmbox
];
}

View file

@ -0,0 +1,10 @@
{inputs, ...}: {
imports = [
inputs.home-manager.nixosModules.default
];
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
};
}

View file

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

View file

@ -0,0 +1,9 @@
_: {
virtualisation.docker = {
enable = true;
rootless = {
enable = true;
setSocketVariable = true;
};
};
}

View file

@ -0,0 +1,6 @@
{
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
}

17
system/services/keyd.nix Normal file
View file

@ -0,0 +1,17 @@
{
services = {
keyd = {
enable = true;
keyboards = {
default = {
ids = ["*"];
settings = {
main = {
capslock = "overload(control, esc)";
};
};
};
};
};
};
}

View file

@ -0,0 +1,22 @@
_: {
hardware.pulseaudio.enable = false;
# rtkit is optional but recommended
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
};
services.pipewire.extraConfig.pipewire."92-low-latency" = {
"context.properties" = {
"default.clock.rate" = 48000;
"default.clock.allowed-rates" = [48000];
"default.clock.quantum" = 2048;
"default.clock.min-quantum" = 1024;
};
};
}

View file

@ -0,0 +1,8 @@
{
services = {
syncthing = {
enable = true;
systemd.services.syncthing.environment.STNODEFAULTFOLDER = "true"; # Don't create default ~/Sync folder
};
};
}