Compare commits

...

17 Commits

Author SHA1 Message Date
3679f36e67 Add gaming skills 2025-12-21 18:32:18 +01:00
d10cc381df add nextcloud to desktop 2025-12-21 17:47:38 +01:00
cc6ebd5224 Install nextcloud-client additions 2025-12-12 22:53:03 +01:00
d51e8ed455 Add /dev/sda luks partition to crypttab, and install nextcloud-client 2025-12-12 22:04:23 +01:00
2a751ee1d4 configure remote wake on lan and ipv6 2025-12-12 07:50:43 +01:00
792fe03d93 Add wake online 2025-12-12 04:42:32 +01:00
918d42ff71 Add wake online 2025-12-12 04:42:20 +01:00
87993b83fe restore qemu to kemu_full 2025-12-11 15:16:47 +01:00
74962924b8 revert flake to a working build 2025-12-09 01:46:47 +01:00
520f40e1bc revert flake 2025-12-08 13:14:03 +01:00
1655f3096d before flake update 2025-12-08 12:04:41 +01:00
Jérémie SALVI
5fb0c51777 flake update 2025-12-02 16:30:27 +01:00
Jérémie SALVI
91e8ccbb4f flake update 2025-12-02 16:25:57 +01:00
ff17f33531 Creating kvm test server 2025-11-22 13:05:42 +01:00
59b184cc2c before flake update 2025-11-21 10:17:59 +01:00
Jérémie SALVI
a925119154 flake update 2025-11-08 15:14:53 +01:00
Jérémie SALVI
e406793840 flake update 2025-11-08 15:10:23 +01:00
31 changed files with 773 additions and 211 deletions

51
flake.lock generated
View File

@@ -3,15 +3,15 @@
"disko": {
"inputs": {
"nixpkgs": [
"nixpkgs"
"nixpkgs-unstable"
]
},
"locked": {
"lastModified": 1760701190,
"narHash": "sha256-y7UhnWlER8r776JsySqsbTUh2Txf7K30smfHlqdaIQw=",
"lastModified": 1766150702,
"narHash": "sha256-P0kM+5o+DKnB6raXgFEk3azw8Wqg5FL6wyl9jD+G5a4=",
"owner": "nix-community",
"repo": "disko",
"rev": "3a9450b26e69dcb6f8de6e2b07b3fc1c288d85f5",
"rev": "916506443ecd0d0b4a0f4cf9d40a3c22ce39b378",
"type": "github"
},
"original": {
@@ -23,11 +23,11 @@
"mysecrets": {
"flake": false,
"locked": {
"lastModified": 1759883911,
"narHash": "sha256-IAKCQ9dIeMAdoi4fQdJAdWlLrNh/PURqGz7pmlo9cUw=",
"lastModified": 1765518969,
"narHash": "sha256-hKJGo0+i7xHDMhN8kicOLT0PA8x8zRzleQs2I2XWVLg=",
"ref": "refs/heads/main",
"rev": "7e39f4cde171d9273efddf2153d972d6fbf2a710",
"revCount": 15,
"rev": "e1c2c590e4655cf887173478765663d20a7efffd",
"revCount": 19,
"type": "git",
"url": "file:///home/beastie/nixos/secrets"
},
@@ -36,13 +36,29 @@
"url": "file:///home/beastie/nixos/secrets"
}
},
"nixpkgs": {
"nixpkgs-stable": {
"locked": {
"lastModified": 1761373498,
"narHash": "sha256-Q/uhWNvd7V7k1H1ZPMy/vkx3F8C13ZcdrKjO7Jv7v0c=",
"lastModified": 1766014764,
"narHash": "sha256-+73VffE5GP5fvbib6Hs1Su6LehG+9UV1Kzs90T2gBLA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "2b0d2b456e4e8452cf1c16d00118d145f31160f9",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-25.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1766070988,
"narHash": "sha256-G/WVghka6c4bAzMhTwT2vjLccg/awmHkdKSd2JrycLc=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "6a08e6bb4e46ff7fcbb53d409b253f6bad8a28ce",
"rev": "c6245e83d836d0433170a16eb185cefe0572f8b8",
"type": "github"
},
"original": {
@@ -56,22 +72,23 @@
"inputs": {
"disko": "disko",
"mysecrets": "mysecrets",
"nixpkgs": "nixpkgs",
"nixpkgs-stable": "nixpkgs-stable",
"nixpkgs-unstable": "nixpkgs-unstable",
"sops-nix": "sops-nix"
}
},
"sops-nix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
"nixpkgs-unstable"
]
},
"locked": {
"lastModified": 1760998189,
"narHash": "sha256-ee2e1/AeGL5X8oy/HXsZQvZnae6XfEVdstGopKucYLY=",
"lastModified": 1766289575,
"narHash": "sha256-BOKCwOQQIP4p9z8DasT5r+qjri3x7sPCOq+FTjY8Z+o=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "5a7d18b5c55642df5c432aadb757140edfeb70b3",
"rev": "9836912e37aef546029e48c8749834735a6b9dad",
"type": "github"
},
"original": {

View File

@@ -2,16 +2,17 @@
description = "A very basic flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-25.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
mysecrets = {
@@ -46,10 +47,10 @@
{
nixosConfigurations = {
#nixos-anywhere -- --flake './#generic' --generate-hardware-config nixos-generate-config ./hosts/generic/hardware-configuration.nix --target-host beastie@192.168.122.204
generic = mkSystem inputs.nixpkgs "x86_64-linux" "generic" "beastie";
test-kvm = mkSystem inputs.nixpkgs "x86_64-linux" "test-kvm" "beastie";
home-nix = mkSystem inputs.nixpkgs "x86_64-linux" "home-nix" "beastie";
work-nix = mkSystem inputs.nixpkgs "x86_64-linux" "work-nix" "beastie";
generic = mkSystem inputs.nixpkgs-stable "x86_64-linux" "generic" "beastie";
test-kvm = mkSystem inputs.nixpkgs-stable "x86_64-linux" "test-kvm" "beastie";
home-nix = mkSystem inputs.nixpkgs-unstable "x86_64-linux" "home-nix" "beastie";
work-nix = mkSystem inputs.nixpkgs-unstable "x86_64-linux" "work-nix" "beastie";
# live-usb = mkSystem inputs.nixpkgs "x86_64-linux" "live-usb" "beastie";
#nixos-rebuild switch --flake ./#home-nix --sudo
};

View File

@@ -5,7 +5,7 @@
...
}:
{
system.stateVersion = "25.11";
system.stateVersion = "25.05";
imports = [
./disk-config.nix
@@ -83,6 +83,7 @@
pkgs.nixos-anywhere
pkgs.nixos-generators
pkgs.ssh-to-age
pkgs.htop
];
services.openssh.enable = true;

View File

@@ -6,7 +6,7 @@
disk = {
main = {
type = "disk";
device = "/dev/nvme0n1";
device = "/dev/vda";
content = {
type = "gpt";
partitions = {
@@ -23,42 +23,88 @@
};
SYS = {
size = "100%";
type = "8309";
type = "8300";
name = "SYS";
content = {
type = "luks";
name = "rootfs";
settings = {
allowDiscards = true;
};
content = {
type = "btrfs";
extraArgs = [ "-f --nodiscard --label root" ];
subvolumes = {
"@" = {
mountpoint = "/";
mountOptions = [ "defaults" "ssd" "compress=zstd" "autodefrag" "noatime" "nodiscard" ];
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
"@root" = {
mountpoint = "/root";
mountOptions = [ "defaults" "ssd" "compress=zstd" "autodefrag" "noatime" "nodiscard" ];
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
"@home" = {
mountpoint = "/home";
mountOptions = [ "defaults" "ssd" "compress=zstd" "autodefrag" "noatime" "nodiscard" ];
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
"@nix" = {
mountpoint = "/nix";
mountOptions = [ "defaults" "ssd" "compress=zstd" "autodefrag" "noatime" "nodiscard" ];
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
"@var" = {
mountpoint = "/var";
mountOptions = [ "defaults" "ssd" "compress=zstd" "autodefrag" "noatime" "nodiscard" ];
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
"@games" = {
"@data" = {
mountpoint = "/games";
mountOptions = [ "defaults" "ssd" "compress=zstd" "autodefrag" "noatime" "nodiscard" ];
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
"@backups" = {
mountpoint = "/games";
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
};
};

View File

@@ -5,14 +5,13 @@
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
[ (modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@@ -1,6 +1,4 @@
{
pkgs,
username,
hostname,
modulesPath,
inputs,

View File

@@ -37,27 +37,69 @@
subvolumes = {
"@" = {
mountpoint = "/";
mountOptions = [ "defaults" "ssd" "compress=zstd" "autodefrag" "noatime" "nodiscard" ];
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
"@root" = {
mountpoint = "/root";
mountOptions = [ "defaults" "ssd" "compress=zstd" "autodefrag" "noatime" "nodiscard" ];
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
"@home" = {
mountpoint = "/home";
mountOptions = [ "defaults" "ssd" "compress=zstd" "autodefrag" "noatime" "nodiscard" ];
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
"@nix" = {
mountpoint = "/nix";
mountOptions = [ "defaults" "ssd" "compress=zstd" "autodefrag" "noatime" "nodiscard" ];
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
"@var" = {
mountpoint = "/var";
mountOptions = [ "defaults" "ssd" "compress=zstd" "autodefrag" "noatime" "nodiscard" ];
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
"@games" = {
mountpoint = "/games";
mountOptions = [ "defaults" "ssd" "compress=zstd" "autodefrag" "noatime" "nodiscard" ];
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
};
};

View File

@@ -1,18 +1,47 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
config,
lib,
modulesPath,
...
}:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.availableKernelModules = [
"xhci_pci"
"ehci_pci"
"ahci"
"nvme"
"usbhid"
"usb_storage"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
environment.etc."crypttab".text = ''
datafs UUID=5ca962a7-537f-46ce-ba50-9cc9cefd012b /etc/secrets/datafs.key luks
'';
fileSystems."/data" = {
device = "/dev/disk/by-uuid/a8ea6a7b-3733-40d8-bee8-45806aaacfe1";
fsType = "btrfs";
options = [
"defaults"
"compress=zstd"
"autodefrag"
"noatime"
"nofail"
];
};
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@@ -7,50 +7,13 @@
...
}:
{
system.stateVersion = "25.11";
system.stateVersion = "25.05";
imports = builtins.trace "${inputs.mysecrets}" [
(modulesPath + "/installer/scan/not-detected.nix")
./network.nix
./disk-config.nix
./hardware-configuration.nix
../../modules/core
../../modules/optionnals/hosts/${hostname}.nix
];
boot.kernelPackages = pkgs.linuxPackages_latest;
time.timeZone = "Europe/Paris";
nix = {
settings = {
## Enable flakes
experimental-features = [
"nix-command"
"flakes"
];
## Users trusted to use flake command
trusted-users = [
"root"
"${username}"
];
};
};
## Enable virtualisation guest settings
services.qemuGuest.enable = true;
services.spice-vdagentd.enable = true;
services.xserver = {
videoDrivers = [ "modesetting" ]; # Driver vidéo optimisé pour QEMU/KVM
};
environment.systemPackages = [
pkgs.spice-gtk # Outils SPICE
pkgs.spice-protocol # Protocoles SPICE
];
#fileSystems."/" = {
# device = "/dev/vda2"; # Disque virtuel typique
# fsType = "btrfs";
#};
}

View File

@@ -10,22 +10,103 @@
content = {
type = "gpt";
partitions = {
ESP = {
EFI = {
size = "512M";
type = "EF00";
name = "EFI";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
root = {
SYS = {
size = "100%";
type = "8300";
name = "SYS";
content = {
type = "filesystem";
format = "btrfs";
type = "btrfs";
extraArgs = [ "-f --nodiscard --label root" ];
subvolumes = {
"@" = {
mountpoint = "/";
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
"@root" = {
mountpoint = "/root";
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
"@home" = {
mountpoint = "/home";
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
"@nix" = {
mountpoint = "/nix";
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
"@var" = {
mountpoint = "/var";
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
"@data" = {
mountpoint = "/games";
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
"@backups" = {
mountpoint = "/games";
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
};
};
};
};

View File

@@ -1,38 +1,16 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
pkgs,
modulesPath,
...
}:
{ config, lib, pkgs, modulesPath, ... }:
{
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
imports =
[ (modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [
"ahci"
"xhci_pci"
"virtio_pci"
"sr_mod"
"virtio_blk"
"virtio_scsi"
"virtio_net"
"virtio_blk"
];
boot.initrd.kernelModules = [
"virtio_balloon"
"virtio_console"
"virtio_rng"
];
boot.kernelModules = [
"kvm-intel"
"virtio-gpu"
];
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";

View File

@@ -1,6 +1,4 @@
{
pkgs,
username,
hostname,
modulesPath,
inputs,

View File

@@ -23,6 +23,8 @@
pkgs.jq
pkgs.bash
pkgs.fzf
pkgs.bc
pkgs.wakeonlan
];
services = {
locate = {

View File

@@ -2,8 +2,6 @@
pkgs,
username,
hostname,
modulesPath,
inputs,
...
}:
{
@@ -23,12 +21,14 @@
"root"
"${username}"
];
## Use 24 cores during building phases
cores = 24;
max-jobs = "auto";
};
};
networking = {
hostName = "${hostname}";
networkmanager.enable = true;
firewall.enable = true;
};
}

View File

@@ -18,7 +18,7 @@
"video"
];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAKMJ3TkEmRQcX7RQijNa2km6a2xXJk6M6FERh7C9nTJ"
config.sops.secrets."ssh_keys/beastie_priv".path
];
shell = pkgs.zsh;
};

View File

@@ -4,37 +4,36 @@
}:
{
# Activer Ollama comme service
services.ollama = {
enable = true;
acceleration = "cuda";
environmentVariables = {
OLLAMA_FLASH_ATTENTION = "1"; # ← Flash Attention
OLLAMA_NUM_PARALLEL = "2"; # ← Requêtes parallèles
OLLAMA_MAX_LOADED_MODELS = "1"; # ← Garder 2 modèles en VRAM
OLLAMA_KEEP_ALIVE = "5m";
};
};
services.open-webui = {
enable = true;
port = 8080; # Port par défaut
host = "127.0.0.1"; # Localhost uniquement
openFirewall = true;
# Pour accès réseau : host = "0.0.0.0";
environment = {
ANONYMIZED_TELEMETRY = "True";
DO_NOT_TRACK = "True";
SCARF_NO_ANALYTICS = "True";
# URL d'Ollama (local)
OLLAMA_BASE_URL = "http://127.0.0.1:11434";
# Autres options optionnelles (https://docs.openwebui.com/getting-started/env-configuration/#web-search)
WEBUI_AUTH = "False"; # Desactive l'authentification
# ENABLE_WEB_SEARCH = "True";
# ENABLE_SEARCH_QUERY_GENERATION = "True";
# WEB_SEARCH_ENGINE = "duckduckgo";
# WEB_LOADER_ENGINE = "safe_web";
};
};
# services.ollama = {
# enable = true;
# acceleration = "cuda";
# environmentVariables = {
# OLLAMA_FLASH_ATTENTION = "1"; # ← Flash Attention
# OLLAMA_NUM_PARALLEL = "2"; # ← Requêtes parallèles
# OLLAMA_MAX_LOADED_MODELS = "1"; # ← Garder 2 modèles en VRAM
# OLLAMA_KEEP_ALIVE = "5m";
# };
# };
# services.open-webui = {
# enable = true;
# port = 8080; # Port par défaut
# host = "127.0.0.1"; # Localhost uniquement
# openFirewall = true;
# # Pour accès réseau : host = "0.0.0.0";
# environment = {
# ANONYMIZED_TELEMETRY = "True";
# DO_NOT_TRACK = "True";
# SCARF_NO_ANALYTICS = "True";
# # URL d'Ollama (local)
# OLLAMA_BASE_URL = "http://127.0.0.1:11434";
# # Autres options optionnelles (https://docs.openwebui.com/getting-started/env-configuration/#web-search)
# WEBUI_AUTH = "False"; # Desactive l'authentification
# # ENABLE_WEB_SEARCH = "True";
# # ENABLE_SEARCH_QUERY_GENERATION = "True";
# # WEB_SEARCH_ENGINE = "duckduckgo";
# # WEB_LOADER_ENGINE = "safe_web";
# };
# };
environment = {
systemPackages = [
pkgs.lmstudio
@@ -43,8 +42,5 @@
variables = {
OLLAMA_API_BASE = "http://localhost:11434";
};
shellAliases = {
aider = "aider --config ~/.config/aider/.aider.conf.yml";
};
};
}

View File

@@ -74,7 +74,7 @@ in
(pkgs.vscode-with-extensions.override {
vscode = pkgs.vscodium;
vscodeExtensions = [
pkgs.vscode-extensions.continue.continue
# pkgs.vscode-extensions.continue.continue
pkgs.vscode-extensions.catppuccin.catppuccin-vsc
pkgs.vscode-extensions.catppuccin.catppuccin-vsc-icons
pkgs.vscode-extensions.jnoortheen.nix-ide

View File

@@ -21,7 +21,7 @@ $terminal = kitty
exec-once = hyprpaper
exec-once = waybar
exec-once = nextcloud
#############################
### ENVIRONMENT VARIABLES ###

View File

@@ -0,0 +1,18 @@
{
pkgs,
...
}:
{
hardware.graphics.enable32Bit = true;
programs.steam.enable = true;
programs.steam.gamescopeSession.enable = true;
programs.gamemode.enable = true;
environment.systemPackages = with pkgs; [
vulkan-tools
lutris
wine-staging
winetricks
mangohud
protonup-ng
];
}

View File

@@ -0,0 +1,12 @@
{
pkgs,
...
}:
{
services.gnome.gnome-keyring.enable = true;
environment.systemPackages = [
pkgs.nextcloud-client
pkgs.seahorse
];
}

View File

@@ -9,6 +9,7 @@
pkgs.yt-dlp
pkgs.chromium
pkgs.firefox
pkgs.thunderbird
pkgs.keepassxc
pkgs.nwg-look
pkgs.gimp

View File

@@ -1,5 +1,4 @@
{
pkgs,
...
}:
{

View File

@@ -5,30 +5,41 @@
}:
{
imports = [
../ai.nix
#../ai.nix
../autologin.nix
../k8s.nix
../libvirt.nix
../openfortivpn.nix
../options.nix
../packages.nix
../sops-desktop.nix
../ssh.nix
../sudo-nopasswd.nix
../wakeonlan.nix
### Import GUI modules
../desktop/code.nix
../desktop/dunst.nix
../desktop/gaming.nix
../desktop/kitty.nix
../desktop/nextcloud.nix
../desktop/packages.nix
../desktop/pipewire.nix
../desktop/qwerty-fr.nix
../desktop/rofi.nix
../desktop/starship.nix
../desktop/virt-manager.nix
../desktop/wayland.nix
### Import Graphics modules
../desktop/nvidia.nix
];
my.laninterface = "enp5s0";
my.ipv4address = "192.168.0.2";
my.ipv4netmask = 24;
my.ipv4gateway = "192.168.0.254";
sops = {
secrets = {
"wireguard_home/publickey" = { };
@@ -37,25 +48,31 @@
};
};
#services.resolved.enable = false;
networking = {
interfaces.enp5s0 = {
#useNetworkd = true;
#useHostResolvConf = false;
interfaces.${config.my.laninterface} = {
ipv4.addresses = [
{
address = "192.168.0.2";
prefixLength = 24;
address = config.my.ipv4address;
prefixLength = config.my.ipv4netmask;
}
];
};
defaultGateway = {
address = "192.168.0.254";
interface = "enp5s0";
address = config.my.ipv4gateway;
interface = config.my.laninterface;
};
nameservers = [
#"9.9.9.9"
"10.0.0.1"
"2001:41d0:303:20da::1"
"217.182.138.218"
];
extraHosts = ''
#172.18.229.240 test-mycarto.grandbesancon.fr
172.18.21.172 errorpages.grandbesancon.fr
#172.18.23.4 dozzle.grandbesancon.fr
#172.18.22.206 toto.grandbesancon.fr
@@ -90,5 +107,30 @@
};
};
};
environment.systemPackages = [ pkgs.tor-browser ];
sops.secrets."home-nix/myipv6address" = { };
systemd.services.ipv6-setup = {
description = "Configure IPv6";
after = [
"network.target"
"sops-nix.service"
];
wants = [ "sops-nix.service" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
ExecStart = pkgs.writeShellScript "setup-ipv6" ''
${pkgs.iproute2}/bin/ip -6 addr add $(cat ${
config.sops.secrets."home-nix/myipv6address".path
})/64 dev ${config.my.laninterface} || true
'';
};
};
environment.systemPackages = [
pkgs.tor-browser
];
}

View File

@@ -1,4 +1,5 @@
{
pkgs,
...
}:
{
@@ -6,14 +7,70 @@
../sops-desktop.nix
../sudo-nopasswd.nix
../autologin.nix
../ssh.nix
../packages.nix
### Import GUI modules
../desktop/dunst.nix
../desktop/kitty.nix
../desktop/packages.nix
../desktop/qwerty-fr.nix
../desktop/rofi.nix
../desktop/wayland.nix
## Server
../server/starship.nix
../server/wireguard-ui.nix
];
## Enable virtualisation guest settings
services.qemuGuest.enable = true;
services.spice-vdagentd.enable = true;
services.xserver = {
videoDrivers = [ "modesetting" ]; # Driver vidéo optimisé pour QEMU/KVM
};
environment.systemPackages = [
pkgs.spice-gtk # Outils SPICE
pkgs.spice-protocol # Protocoles SPICE
];
systemd.network.links."10-eth0" = {
matchConfig.MACAddress = "52:54:00:a3:d7:56";
linkConfig.Name = "eth0";
};
systemd.network.netdevs."10-dummy0" = {
netdevConfig = {
Kind = "dummy";
Name = "dummy0";
};
};
networking = {
useNetworkd = true;
useDHCP = false;
interfaces = {
dummy0 = {
ipv4.addresses = [
{
address = "192.168.2.1";
prefixLength = 24;
}
];
};
eth0 = {
ipv4.addresses = [
{
address = "192.168.122.10";
prefixLength = 24;
}
];
};
};
defaultGateway = {
address = "192.168.122.1";
interface = "eth0";
};
nameservers = [
#"9.9.9.9"
"2001:41d0:303:20da::1"
"217.182.138.218"
];
extraHosts = ''
172.18.21.172 errorpages.grandbesancon.fr
'';
};
}

View File

@@ -9,6 +9,7 @@
enable = true;
qemu = {
package = pkgs.qemu_full;
#package = pkgs.qemu;
runAsRoot = true;
swtpm.enable = true;
};

View File

@@ -0,0 +1,26 @@
{
lib,
...
}:
{
options.my.laninterface = lib.mkOption {
type = lib.types.str;
default = "enp5s0";
};
options.my.ipv4address = lib.mkOption {
type = lib.types.str;
default = "127.0.0.1";
};
options.my.ipv4netmask = lib.mkOption {
type = lib.types.int;
default = 8;
};
options.my.ipv4gateway = lib.mkOption {
type = lib.types.str;
default = "127.0.0.254";
};
options.my.wolipv6address = lib.mkOption {
type = lib.types.str;
default = "fc::0";
};
}

View File

@@ -0,0 +1,101 @@
{
...
}:
{
environment.sessionVariables = {
KUBECONFIG = "$HOME/.kube/config";
};
programs.starship = {
enable = true;
settings = {
add_newline = true;
command_timeout = 1300;
scan_timeout = 50;
format = "[](fg:surface1)$hostname$username$directory$git_branch$git_status[](fg:base bg:sky)$fill$kubernetes$time[ ](fg:surface1)$line_break[ ](fg:surface1)";
right_format = "[](fg:surface1)";
palette = "catppuccin_frappe";
hostname = {
ssh_only = false;
format = "[](bg:base fg:mauve)[ $hostname ](bg:mauve fg:base)[](bg:mauve fg:blue)";
disabled = false;
};
username = {
style_user = "bg:blue fg:base";
style_root = "bg:red fg:base bold";
format = "[ $user ]($style)[](bg:blue fg:sapphire)";
show_always = true;
disabled = false;
};
directory = {
format = "[ $path ](bg:sapphire fg:base)[](bg:sapphire fg:sky)";
truncation_length = 3;
truncation_symbol = "/";
};
git_branch = {
symbol = " ";
format = "[ $symbol$branch(:$remote_branch) ](fg:base bg:sky)";
disabled = false;
};
git_status = {
format = "([$all_status$ahead_behind ](fg:base bg:sky))";
conflicted = "😵";
ahead = "";
behind = "";
diverged = "😵";
up_to_date = "";
untracked = "";
stashed = "📦";
modified = "";
#staged = "[($count)](fg:base bg:sapphire)"
staged = "";
renamed = "";
deleted = "";
disabled = false;
};
fill = {
symbol = "";
style = "surface1";
};
kubernetes = {
disabled = false;
format = "[](fg:blue bg:base)[ ($namespace)/($cluster) ](fg:base bg:blue)[](bg:blue fg:mauve)";
};
palettes.catppuccin_frappe = {
rosewater = "#f2d5cf";
flamingo = "#eebebe";
pink = "#f4b8e4";
mauve = "#ca9ee6";
red = "#e78284";
maroon = "#ea999c";
peach = "#ef9f76";
yellow = "#e5c890";
green = "#a6d189";
teal = "#81c8be";
sky = "#99d1db";
sapphire = "#85c1dc";
blue = "#8caaee";
lavender = "#babbf1";
text = "#c6d0f5";
subtext1 = "#b5bfe2";
subtext0 = "#a5adce";
overlay2 = "#949cbb";
overlay1 = "#838ba7";
overlay0 = "#737994";
surface2 = "#626880";
surface1 = "#51576d";
surface0 = "#414559";
base = "#303446";
mantle = "#292c3c";
crust = "#232634";
};
};
};
}

View File

@@ -0,0 +1,97 @@
{
pkgs,
...
}:
{
environment.systemPackages = [
pkgs.wireguard-tools
pkgs.wireguard-ui
];
users.users.wireguard-ui = {
isSystemUser = true;
group = "wireguard-ui";
home = "/var/lib/wireguard-ui";
createHome = true;
description = "WireGuard UI service user";
};
users.groups.wireguard-ui = { };
systemd = {
tmpfiles.rules = [
"d /etc/wireguard 0750 wireguard-ui wireguard-ui -"
"d /var/lib/wireguard-ui 0750 wireguard-ui wireguard-ui -"
];
services = {
wg-quick-wg0 = {
description = "WireGuard via wg-quick(8) for wg0";
after = [
"network-online.target"
"wireguard-ui.service"
];
wants = [ "network-online.target" ];
wantedBy = [
"multi-user.target"
"sshd.service"
];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
ExecStart = "${pkgs.wireguard-tools}/bin/wg-quick up wg0";
ExecStop = "${pkgs.wireguard-tools}/bin/wg-quick down wg0";
ExecReload = "${pkgs.bash}/bin/bash -c 'exec ${pkgs.wireguard-tools}/bin/wg syncconf wg0 <(exec ${pkgs.wireguard-tools}/bin/wg-quick strip wg0)'";
Environment = [ "WG_ENDPOINT_RESOLUTION_RETRIES=infinity" ];
};
};
wireguard-ui = {
description = "WireGuard UI";
documentation = [ "https://github.com/ngoduykhanh/wireguard-ui" ];
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
serviceConfig = {
ExecStart = "${pkgs.wireguard-ui}/bin/wireguard-ui";
Restart = "on-failure";
WorkingDirectory = "/var/lib/wireguard-ui";
StateDirectory = "wireguard-ui";
User = "wireguard-ui";
Group = "wireguard-ui";
ReadWritePaths = [
"/var/lib/wireguard-ui"
"/etc/wireguard"
];
Environment = [
# "WGUI_ENDPOINT_ADDRESS=${config.custom.wireguard-ui.endpointAddress}"
# "WGUI_DNS=${config.custom.wireguard-ui.dns}"
];
AmbientCapabilities = "CAP_NET_ADMIN";
};
};
wg-quick-wg0-reload = {
description = "Reload WireGuard config";
serviceConfig = {
Type = "oneshot";
ExecStart = "${pkgs.systemd}/bin/systemctl reload wg-quick-wg0.service";
};
};
};
paths.wg-quick-wg0-reload = {
description = "Watch /etc/wireguard/wg0.conf for changes";
wantedBy = [ "multi-user.target" ];
pathConfig = {
PathModified = "/etc/wireguard/wg0.conf";
};
};
};
networking.firewall.allowedTCPPorts = [ 5000 ];
networking.firewall.allowedUDPPorts = [ 51820 ];
}

View File

@@ -61,6 +61,16 @@ in
mode = "0600";
path = "/home/${username}/.ssh/id_ed25519_gitea_semaphore";
};
"ssh_keys/wol_pub" = {
owner = "${username}";
mode = "0644";
path = "/home/${username}/.ssh/id_ed25519_wol";
};
"ssh_keys/wol_priv" = {
owner = "${username}";
mode = "0600";
path = "/home/${username}/.ssh/id_ed25519_wol.priv";
};
};
};
}

View File

@@ -0,0 +1,47 @@
{
config,
pkgs,
hostname,
...
}:
{
systemd.services."wol${config.my.laninterface}" = {
description = "Wake-on-LAN for ${config.my.laninterface}";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "oneshot";
ExecStart = "${pkgs.ethtool}/bin/ethtool -s ${config.my.laninterface} wol g";
RandomizedDelaySec = "30s";
};
};
environment.systemPackages = [ pkgs.ethtool ];
my.wolipv6address = "2a01:e0a:9cc:99d0:8f3a:6b2c:41d7:e9f5";
boot.initrd = {
network = {
enable = true;
ssh = {
enable = true;
port = 65234;
authorizedKeys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ2+PXfG/37rsvcVr2RAHzXmGHMr8+8iBH//1YS+zWd3"
]; # ta clé publique
hostKeys = [ "/etc/ssh/ssh_host_ed25519_key" ];
};
postCommands = ''
ip -6 addr add ${config.my.wolipv6address}/64 dev ${config.my.laninterface}
ip -6 route add default via fe80::224:d4ff:fea5:65bd dev ${config.my.laninterface}
'';
};
availableKernelModules = [ "r8169" ];
};
boot = {
kernelParams = [
"ip=${config.my.ipv4address}::255.255.255.0:${config.my.ipv4gateway}:${hostname}:${config.my.laninterface}:off"
];
};
}