Compare commits
No commits in common. "912213803f4e6ed8f90398e492d58c5f6a7bed9e" and "275cd012431c403079a67a61cbc6af02f7a0350a" have entirely different histories.
912213803f
...
275cd01243
74
README.md
74
README.md
@ -1,74 +0,0 @@
|
|||||||
# NixOS Configuration
|
|
||||||
|
|
||||||
Personal NixOS configuration for my machines, using Nix Flakes for reproducible and shareable setups.
|
|
||||||
|
|
||||||
## Repository Structure
|
|
||||||
|
|
||||||
- **flake.nix**: Main entry point for the Nix Flake, defining NixOS and home-manager configurations
|
|
||||||
- **hosts/**: Host-specific NixOS configurations
|
|
||||||
- **modules/**: Custom NixOS modules reusable across different hosts
|
|
||||||
- **programs/**: System-level programs shared across hosts
|
|
||||||
- **secrets/**: Encrypted secrets managed with sops-nix
|
|
||||||
- **system/**: Common system-level configurations shared across hosts
|
|
||||||
- **users/phundrak/**: Home-manager configuration for my user
|
|
||||||
- **users/modules/**: Custom user modules reusable across configurations
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
### System Management
|
|
||||||
|
|
||||||
Update flake dependencies:
|
|
||||||
```bash
|
|
||||||
nix flake update
|
|
||||||
```
|
|
||||||
|
|
||||||
Build and switch to a new system configuration:
|
|
||||||
```bash
|
|
||||||
sudo nixos-rebuild switch --flake .#<hostname>
|
|
||||||
```
|
|
||||||
|
|
||||||
Using the Nix Helper (nh) tool:
|
|
||||||
```bash
|
|
||||||
# Build and activate a new configuration, making it the boot default
|
|
||||||
nh os switch
|
|
||||||
|
|
||||||
# Build a new configuration and make it the boot default
|
|
||||||
nh os boot
|
|
||||||
|
|
||||||
# Build and activate a new configuration (without making it the boot default)
|
|
||||||
nh os test
|
|
||||||
|
|
||||||
# Just build a new configuration
|
|
||||||
nh os build
|
|
||||||
```
|
|
||||||
|
|
||||||
### Home Configuration
|
|
||||||
|
|
||||||
Update and switch to a new home configuration:
|
|
||||||
```bash
|
|
||||||
nh home switch
|
|
||||||
```
|
|
||||||
|
|
||||||
Format Nix files (using Alejandra):
|
|
||||||
```bash
|
|
||||||
nix fmt
|
|
||||||
```
|
|
||||||
|
|
||||||
## Development
|
|
||||||
|
|
||||||
For development, a devShell is provided with linting tools and git hooks:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
nix develop
|
|
||||||
```
|
|
||||||
|
|
||||||
This will set up an environment with:
|
|
||||||
- alejandra (formatting)
|
|
||||||
- commitizen (commit messages)
|
|
||||||
- deadnix (dead code detection)
|
|
||||||
- statix (linting)
|
|
||||||
- Other useful git hooks
|
|
||||||
|
|
||||||
## Contributing
|
|
||||||
|
|
||||||
Feel free to fork this repository and make your own changes. If you have any improvements or suggestions, please open an issue or submit a pull request.
|
|
37
README.org
Normal file
37
README.org
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
#+title: NixOS Configuration
|
||||||
|
#+author: Lucien Cartier-Tilet <lucien@phundrak.com>
|
||||||
|
|
||||||
|
This repository contains the NixOS configuration for my personal
|
||||||
|
setup. It uses Nix Flakes to manache the configuration, making it
|
||||||
|
reproducible and easy to share across my different machines.
|
||||||
|
|
||||||
|
* Repository Structure
|
||||||
|
- =flake.nix= :: The main entry point for the Nix Flake. It defines my
|
||||||
|
NixOS configurations as well as a dev shell which installs the tools
|
||||||
|
needed for testing and building my configurations.
|
||||||
|
- =hosts/= :: Directory containing host-specific configurations. Each
|
||||||
|
host has its own directory with at least a =configuration.nix= file.
|
||||||
|
- =modules/= :: Custom NixOS modules that can be reused across different
|
||||||
|
hosts.
|
||||||
|
- =programs/= :: Programs shared across hosts at the system level that
|
||||||
|
are not made into configurable modules.
|
||||||
|
- =secrets/= :: Contains secret values that I cannot or will not share
|
||||||
|
publicly.
|
||||||
|
- =system/= :: Common system-level configuration shared across hosts
|
||||||
|
that are not made into configurable modules.
|
||||||
|
- =users/phundrak/= :: My home-manager configuration, containing
|
||||||
|
user-specific settings and applications.
|
||||||
|
- =users/modules/= :: Custom user NixOS modules that can be reused
|
||||||
|
across different users.
|
||||||
|
- =user/scripts/= :: Custom shell scripts shared across users.
|
||||||
|
|
||||||
|
* Updating and Rebuilding the Configuration
|
||||||
|
In this repository, there are two helper scripts:
|
||||||
|
- =update.sh= :: Updates the Flake’s lockfile.
|
||||||
|
- =rebuild.sh= :: Rebuilds the configuration and switch to it
|
||||||
|
immediately.
|
||||||
|
|
||||||
|
* Contributing
|
||||||
|
Feel free to fork this repository and make your own changes. If you
|
||||||
|
have any improvements or suggestions, please open an issue or submit a
|
||||||
|
pull request.
|
69
flake.lock
generated
69
flake.lock
generated
@ -88,24 +88,6 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-utils": {
|
|
||||||
"inputs": {
|
|
||||||
"systems": "systems"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1731533236,
|
|
||||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"git-hooks": {
|
"git-hooks": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": [
|
"flake-compat": [
|
||||||
@ -308,18 +290,17 @@
|
|||||||
},
|
},
|
||||||
"pumo-system-info": {
|
"pumo-system-info": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils",
|
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
],
|
],
|
||||||
"rust-overlay": "rust-overlay"
|
"rust-overlay": "rust-overlay"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1748984111,
|
"lastModified": 1748127405,
|
||||||
"narHash": "sha256-SP1/+cCHnPg0UqylHCzeKNx61wGapLrYRn5UKiiDicc=",
|
"narHash": "sha256-5Xh7VXmjeK5m8Dxt2bti8A2HdkpmPftHc2+WXH3tQH8=",
|
||||||
"ref": "refs/heads/develop",
|
"ref": "refs/heads/develop",
|
||||||
"rev": "f9fe233b6cb669a718a0ddb529793159d39ba32e",
|
"rev": "06fa652f9626590a9727f3ec8b48330ad3fcb78f",
|
||||||
"revCount": 9,
|
"revCount": 6,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://labs.phundrak.com/phundrak/pumo-system-info"
|
"url": "https://labs.phundrak.com/phundrak/pumo-system-info"
|
||||||
},
|
},
|
||||||
@ -328,26 +309,6 @@
|
|||||||
"url": "https://labs.phundrak.com/phundrak/pumo-system-info"
|
"url": "https://labs.phundrak.com/phundrak/pumo-system-info"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"quickshell": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1749772873,
|
|
||||||
"narHash": "sha256-ZsFQIs3ZpUud1QmR1TyhAW0LGbjHzCkA79YCLBbJ12A=",
|
|
||||||
"ref": "refs/heads/master",
|
|
||||||
"rev": "517143adf97fb0df7e9a7584061deecdffb19faf",
|
|
||||||
"revCount": 576,
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://git.outfoxxed.me/outfoxxed/quickshell"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://git.outfoxxed.me/outfoxxed/quickshell"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"devenv": "devenv",
|
"devenv": "devenv",
|
||||||
@ -355,7 +316,6 @@
|
|||||||
"nix-index-database": "nix-index-database",
|
"nix-index-database": "nix-index-database",
|
||||||
"nixpkgs": "nixpkgs_4",
|
"nixpkgs": "nixpkgs_4",
|
||||||
"pumo-system-info": "pumo-system-info",
|
"pumo-system-info": "pumo-system-info",
|
||||||
"quickshell": "quickshell",
|
|
||||||
"sops-nix": "sops-nix",
|
"sops-nix": "sops-nix",
|
||||||
"zen-browser": "zen-browser"
|
"zen-browser": "zen-browser"
|
||||||
}
|
}
|
||||||
@ -368,11 +328,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1748918260,
|
"lastModified": 1748054080,
|
||||||
"narHash": "sha256-KhXNXQ5IDLvwwYfJ0pXDjwIuisZ2qM6F7fcXjIGZy/4=",
|
"narHash": "sha256-rwFiLLNCwkj9bqePtH1sMqzs1xmohE0Ojq249piMzF4=",
|
||||||
"owner": "oxalica",
|
"owner": "oxalica",
|
||||||
"repo": "rust-overlay",
|
"repo": "rust-overlay",
|
||||||
"rev": "c9736155bc1eb7c7cf3a925920850e61c07ab22a",
|
"rev": "2221d8d53c128beb69346fa3ab36da3f19bb1691",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -401,21 +361,6 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"systems": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1681028828,
|
|
||||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"zen-browser": {
|
"zen-browser": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
@ -20,11 +20,6 @@
|
|||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
quickshell = {
|
|
||||||
url = "git+https://git.outfoxxed.me/outfoxxed/quickshell";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
|
|
||||||
sops-nix = {
|
sops-nix = {
|
||||||
url = "github:Mic92/sops-nix";
|
url = "github:Mic92/sops-nix";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
../../modules/ssh.nix
|
../../modules/ssh.nix
|
||||||
../../modules/endlessh.nix
|
../../modules/endlessh.nix
|
||||||
../../programs/nano.nix
|
../../programs/nano.nix
|
||||||
./services
|
|
||||||
];
|
];
|
||||||
|
|
||||||
system = {
|
system = {
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
imports = [./nextcloud-cron.nix];
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
{pkgs, ...}: {
|
|
||||||
systemd = {
|
|
||||||
timers."nextcloud-cron" = {
|
|
||||||
wantedBy = [""];
|
|
||||||
timerConfig = {
|
|
||||||
OnBootSec = "5m";
|
|
||||||
OnUnitActiveSec = "5m";
|
|
||||||
Unit = "nextcloud-cron.service";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
services."nextcloud-cron" = {
|
|
||||||
script = ''
|
|
||||||
set -eu
|
|
||||||
${pkgs.docker}/bin/docker exec -u www-data -it nextcloud-nextcloud-1 php /var/www/html/cron.php
|
|
||||||
'';
|
|
||||||
serviceConfig = {
|
|
||||||
Type = "oneshot";
|
|
||||||
User = "root";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -50,7 +50,7 @@ in {
|
|||||||
input = {
|
input = {
|
||||||
kb_layout = "fr";
|
kb_layout = "fr";
|
||||||
kb_variant = "bepo_afnor";
|
kb_variant = "bepo_afnor";
|
||||||
# kb_options = "caps:ctrl_modifier";
|
kb_options = "caps:ctrl_modifier";
|
||||||
numlock_by_default = true;
|
numlock_by_default = true;
|
||||||
follow_mouse = 1;
|
follow_mouse = 1;
|
||||||
touchpad.natural_scroll = false;
|
touchpad.natural_scroll = false;
|
||||||
@ -77,11 +77,21 @@ in {
|
|||||||
new_status = "inherit";
|
new_status = "inherit";
|
||||||
};
|
};
|
||||||
workspace = [
|
workspace = [
|
||||||
"4, layoutopt:orientation:bottom"
|
"2, layoutopt:orientation:bottom"
|
||||||
"1, layoutopt:orientation:bottom"
|
|
||||||
];
|
];
|
||||||
decoration = {
|
decoration = {
|
||||||
rounding = 5;
|
rounding = 5;
|
||||||
|
# blur = {
|
||||||
|
# enable = true;
|
||||||
|
# size = 9;
|
||||||
|
# passes = 1;
|
||||||
|
# };
|
||||||
|
# shadow = {
|
||||||
|
# enable = true;
|
||||||
|
# color = "rgba(2e3440aa)";
|
||||||
|
# range = 4;
|
||||||
|
# render_power = 3;
|
||||||
|
# };
|
||||||
};
|
};
|
||||||
animations = {
|
animations = {
|
||||||
enabled = true;
|
enabled = true;
|
||||||
|
@ -1,25 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
with lib; let
|
|
||||||
cfg = config.modules.ollama;
|
|
||||||
in {
|
|
||||||
options.modules.ollama = {
|
|
||||||
enable = mkEnableOption "Enables Ollama";
|
|
||||||
gpu = mkOption {
|
|
||||||
type = types.nullOr types.enum ["none" "amd" "nvidia"];
|
|
||||||
example = "amd";
|
|
||||||
default = "none";
|
|
||||||
description = "Which type of GPU should be used for hardware acceleration";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config.services.ollama = mkIf cfg.enable {
|
|
||||||
inherit (cfg) enable;
|
|
||||||
environmentVariables = {
|
|
||||||
OLLAMA_CONTEXT_LENGTH = "8192";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -12,7 +12,6 @@ in {
|
|||||||
options.modules.vcs = {
|
options.modules.vcs = {
|
||||||
git = {
|
git = {
|
||||||
enable = mkEnableOption "enables git";
|
enable = mkEnableOption "enables git";
|
||||||
cliff = mkEnableOption "enables git-cliff support";
|
|
||||||
sendmail = {
|
sendmail = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
@ -95,7 +94,7 @@ in {
|
|||||||
'');
|
'');
|
||||||
modules = {
|
modules = {
|
||||||
git = mkIf cfg.git.enable {
|
git = mkIf cfg.git.enable {
|
||||||
inherit (cfg.git) enable cliff sendmail browser completeConfig emacs mergeTool;
|
inherit (cfg.git) enable sendmail browser completeConfig emacs mergeTool;
|
||||||
inherit (cfg) email name editor;
|
inherit (cfg) email name editor;
|
||||||
publicKeyFile = cfg.publicKey.file;
|
publicKeyFile = cfg.publicKey.file;
|
||||||
};
|
};
|
||||||
|
@ -17,7 +17,6 @@ in {
|
|||||||
type = types.str;
|
type = types.str;
|
||||||
default = "Lucien Cartier-Tilet";
|
default = "Lucien Cartier-Tilet";
|
||||||
};
|
};
|
||||||
cliff = mkEnableOption "enables git-cliff support";
|
|
||||||
sendmail = {
|
sendmail = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
@ -78,7 +77,6 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
programs.git-cliff.enable = cfg.cliff;
|
|
||||||
programs.git = let
|
programs.git = let
|
||||||
smtpEmail =
|
smtpEmail =
|
||||||
if (cfg.sendmail.user == null)
|
if (cfg.sendmail.user == null)
|
||||||
|
@ -83,7 +83,7 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
"group/audio" = {
|
"group/audio" = {
|
||||||
modules = ["pulseaudio" "pulseaudio/slider" "mpris"];
|
modules = ["mpris" "pulseaudio" "pulseaudio/slider"];
|
||||||
orientation = "inherit";
|
orientation = "inherit";
|
||||||
drawer.transition-duration = 300;
|
drawer.transition-duration = 300;
|
||||||
};
|
};
|
||||||
|
@ -9,17 +9,16 @@
|
|||||||
./packages.nix
|
./packages.nix
|
||||||
./email.nix
|
./email.nix
|
||||||
../modules/emacs.nix
|
../modules/emacs.nix
|
||||||
../modules/emoji.nix
|
|
||||||
../modules/hyprland.nix
|
|
||||||
../modules/kdeconnect.nix
|
../modules/kdeconnect.nix
|
||||||
../modules/kitty.nix
|
../modules/kitty.nix
|
||||||
|
../modules/hyprland.nix
|
||||||
../modules/mbsync.nix
|
../modules/mbsync.nix
|
||||||
../modules/mpd.nix
|
../modules/mpd.nix
|
||||||
../modules/mpv.nix
|
../modules/mpv.nix
|
||||||
../modules/ollama.nix
|
|
||||||
../modules/qt.nix
|
|
||||||
../modules/wofi.nix
|
../modules/wofi.nix
|
||||||
../modules/yt-dlp.nix
|
../modules/yt-dlp.nix
|
||||||
|
../modules/emoji.nix
|
||||||
|
../modules/qt.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
config = let
|
config = let
|
||||||
@ -56,7 +55,6 @@
|
|||||||
bat.extras = true;
|
bat.extras = true;
|
||||||
packages.emacsPackage = emacsPkg;
|
packages.emacsPackage = emacsPkg;
|
||||||
mopidy.enable = true;
|
mopidy.enable = true;
|
||||||
ollama.enable = true;
|
|
||||||
|
|
||||||
emacs = {
|
emacs = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -89,7 +87,6 @@
|
|||||||
integration = true;
|
integration = true;
|
||||||
pkg = emacsPkg;
|
pkg = emacsPkg;
|
||||||
};
|
};
|
||||||
cliff = true;
|
|
||||||
sendmail = {
|
sendmail = {
|
||||||
enable = true;
|
enable = true;
|
||||||
passwordFile = config.sops.secrets.emailPassword.path;
|
passwordFile = config.sops.secrets.emailPassword.path;
|
||||||
|
@ -21,13 +21,8 @@ in {
|
|||||||
[
|
[
|
||||||
flatpak
|
flatpak
|
||||||
|
|
||||||
# LSP servers
|
# LSP server for Nix
|
||||||
bash-language-server
|
nil
|
||||||
docker-language-server
|
|
||||||
kdePackages.qtdeclarative # For QML LSP
|
|
||||||
nil # Nix
|
|
||||||
python3 # for Emacs and LSP
|
|
||||||
yaml-language-server # Yaml (Docker, GitHub Actions, ...)
|
|
||||||
|
|
||||||
# Terminal stuff
|
# Terminal stuff
|
||||||
duf
|
duf
|
||||||
@ -68,7 +63,6 @@ in {
|
|||||||
watchmate
|
watchmate
|
||||||
inputs.zen-browser.packages.${system}.default
|
inputs.zen-browser.packages.${system}.default
|
||||||
inputs.pumo-system-info.packages.${system}.default
|
inputs.pumo-system-info.packages.${system}.default
|
||||||
inputs.quickshell.packages.${system}.default
|
|
||||||
|
|
||||||
# Games
|
# Games
|
||||||
atlauncher
|
atlauncher
|
||||||
@ -99,6 +93,7 @@ in {
|
|||||||
grype # Vulnerability scanner for container images and filesystems
|
grype # Vulnerability scanner for container images and filesystems
|
||||||
podman-desktop
|
podman-desktop
|
||||||
podman-compose
|
podman-compose
|
||||||
|
python3 # for Emacs and LSP
|
||||||
tectonic # better LaTeX engine
|
tectonic # better LaTeX engine
|
||||||
virt-manager
|
virt-manager
|
||||||
zeal
|
zeal
|
||||||
|
Loading…
x
Reference in New Issue
Block a user