Compare commits

..

3 Commits

Author SHA1 Message Date
c3289c173e add home-nix 2025-09-16 18:45:02 +02:00
522b9c9d7f add home-nix 2025-09-16 18:42:27 +02:00
ea768cf628 add home-nix 2025-09-16 18:40:31 +02:00
17 changed files with 286 additions and 46 deletions

View File

@@ -43,11 +43,21 @@ si on veut utiliser kexec, il faut pousser l'iso en ligne pour que le serveur ci
On ajoute à `~/.ssh/config` On ajoute à `~/.ssh/config`
```
Match User root
IdentityFile ~/.ssh/id_ed25519_beastie
PasswordAuthentication yes
PubkeyAuthentication yes
```
On lance l'installation à distance
``` ```
nixos-anywhere --flake .#generic --target-host root@192.168.122.204 -i ~/.ssh/id_ed25519_beastie --generate-hardware-config nixos-generate-config ./hosts/generic/hardware-configuration.nix nixos-anywhere --flake .#generic --target-host root@192.168.122.204 -i ~/.ssh/id_ed25519_beastie --generate-hardware-config nixos-generate-config ./hosts/generic/hardware-configuration.nix
``` ```
si l'installation est en local, on peux créer le partitionnement avec la commande suivante : Si l'installation est en local, on peux créer le partitionnement avec la commande suivante :
``` ```
sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko/latest -- --yes-wipe-all-disks --mode destroy,format,mount ./disko.nix sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko/latest -- --yes-wipe-all-disks --mode destroy,format,mount ./disko.nix
``` ```

28
flake.lock generated
View File

@@ -7,11 +7,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1752718651, "lastModified": 1757508292,
"narHash": "sha256-PkaR0qmyP9q/MDN3uYa+RLeBA0PjvEQiM0rTDDBXkL8=", "narHash": "sha256-7lVWL5bC6xBIMWWDal41LlGAG+9u2zUorqo3QCUL4p4=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "d5ad4485e6f2edcc06751df65c5e16572877db88", "rev": "146f45bee02b8bd88812cfce6ffc0f933788875a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -23,11 +23,11 @@
"mysecrets": { "mysecrets": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1753346054, "lastModified": 1758040565,
"narHash": "sha256-n7qc4vFKYip1dnLN/45UPlyxE1tOJdd9pg74HBcA96Y=", "narHash": "sha256-Mq2BEI6ik6W49mSBotPi4zva6CyjXqdft+A7hy4ENGw=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "b48db3f949bb9b24d6fa84f4216ba9452f6d6e6b", "rev": "4640274dc3767b3f8b968f801f9f8e3be0619415",
"revCount": 2, "revCount": 3,
"type": "git", "type": "git",
"url": "file:///home/beastie/nixos-secrets" "url": "file:///home/beastie/nixos-secrets"
}, },
@@ -38,11 +38,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1752364307, "lastModified": 1757745802,
"narHash": "sha256-o0Cm4fhz/ukV/excbnwkRB2sqknenkb/0T4pcgXjrp0=", "narHash": "sha256-hLEO2TPj55KcUFUU1vgtHE9UEIOjRcH/4QbmfHNF820=",
"owner": "NixOS", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "b6071be3c0d9404113988e5e253eb6d71d1ddbef", "rev": "c23193b943c6c689d70ee98ce3128239ed9e32d1",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -67,11 +67,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1752544651, "lastModified": 1758007585,
"narHash": "sha256-GllP7cmQu7zLZTs9z0J2gIL42IZHa9CBEXwBY9szT0U=", "narHash": "sha256-HYnwlbY6RE5xVd5rh0bYw77pnD8lOgbT4mlrfjgNZ0c=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "2c8def626f54708a9c38a5861866660395bb3461", "rev": "f77d4cfa075c3de66fc9976b80e0c4fc69e2c139",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -48,9 +48,9 @@
#nixos-anywhere -- --flake './#generic' --generate-hardware-config nixos-generate-config ./hosts/generic/hardware-configuration.nix --target-host beastie@192.168.122.204 #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"; generic = mkSystem inputs.nixpkgs "x86_64-linux" "generic" "beastie";
test-kvm = mkSystem inputs.nixpkgs "x86_64-linux" "test-kvm" "beastie"; test-kvm = mkSystem inputs.nixpkgs "x86_64-linux" "test-kvm" "beastie";
home-nix = mkSystem inputs.nixpkgs "x86_64-linux" "home-nix" "beastie";
# live-usb = mkSystem inputs.nixpkgs "x86_64-linux" "live-usb" "beastie"; # live-usb = mkSystem inputs.nixpkgs "x86_64-linux" "live-usb" "beastie";
#nixos-rebuild switch --flake ./#home-nix --sudo #nixos-rebuild switch --flake ./#home-nix --sudo
#home-nix = mkSystem inputs.nixpkgs "x86_64-linux" "home-nix" "beastie";
}; };
}; };
} }

View File

@@ -5,6 +5,8 @@
... ...
}: }:
{ {
system.stateVersion = "25.11";
imports = [ imports = [
./disk-config.nix ./disk-config.nix
./hardware-configuration.nix ./hardware-configuration.nix
@@ -86,5 +88,4 @@
services.openssh.enable = true; services.openssh.enable = true;
networking.hostName = "${hostname}"; networking.hostName = "${hostname}";
system.stateVersion = "25.11";
} }

View File

@@ -17,15 +17,48 @@
type = "filesystem"; type = "filesystem";
format = "vfat"; format = "vfat";
mountpoint = "/boot"; mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
}; };
}; };
root = { SYS = {
size = "100%"; size = "100%";
type = "8300"; type = "8309";
content = { content = {
type = "filesystem"; type = "luks";
format = "btrfs"; name = "rootfs";
settings = {
allowDiscards = true;
};
content = {
type = "btrfs";
extraArgs = [ "-f --nodiscard --label root" ];
subvolumes = {
"@" = {
mountpoint = "/"; 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" ];
};
"@games" = {
mountpoint = "/games";
mountOptions = [ "defaults" "ssd" "compress=zstd" "autodefrag" "noatime" "nodiscard" ];
};
};
};
}; };
}; };
}; };

View File

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

View File

@@ -0,0 +1,56 @@
{
pkgs,
username,
hostname,
modulesPath,
inputs,
...
}:
{
system.stateVersion = "25.11";
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

@@ -0,0 +1,69 @@
{
...
}:
{
disko.devices = {
disk = {
main = {
type = "disk";
device = "/dev/vda";
content = {
type = "gpt";
partitions = {
ESP = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
SYS = {
size = "100%";
type = "8309";
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" ];
};
"@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" ];
};
"@games" = {
mountpoint = "/games";
mountOptions = [ "defaults" "ssd" "compress=zstd" "autodefrag" "noatime" "nodiscard" ];
};
};
};
};
};
};
};
};
};
};
}

View File

@@ -0,0 +1,25 @@
# 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, ... }:
{
imports =
[
(modulesPath + "/installer/scan/not-detected.nix")
(modulesPath + "/profiles/qemu-guest.nix")
];
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

@@ -0,0 +1,29 @@
{
hostname,
...
}:
{
networking = {
hostName = "${hostname}";
interfaces.enp1s0 = {
ipv4.addresses = [
{
address = "192.168.122.100";
prefixLength = 24;
}
];
};
defaultGateway = {
address = "192.168.122.1";
interface = "enp1s0";
};
nameservers = [
"9.9.9.9"
"2001:41d0:303:20da::1"
"217.182.138.218"
];
networkmanager.enable = true;
firewall.enable = true;
};
}

View File

@@ -64,7 +64,6 @@
pkgs.curl pkgs.curl
pkgs.nixos-anywhere pkgs.nixos-anywhere
pkgs.nixos-generators pkgs.nixos-generators
pkgs.dhcp
]; ];
# Needed for https://github.com/NixOS/nixpkgs/issues/58959 # Needed for https://github.com/NixOS/nixpkgs/issues/58959
@@ -84,5 +83,3 @@
mode = "0440"; mode = "0440";
}; };
} }
# Config nvim

View File

@@ -6,7 +6,6 @@
environment.systemPackages = [ environment.systemPackages = [
pkgs.curl pkgs.curl
pkgs.pciutils pkgs.pciutils
# pkgs.clinfo <- IDC info, move to GPU
pkgs.git pkgs.git
pkgs.htop pkgs.htop
pkgs.killall pkgs.killall

View File

@@ -0,0 +1,14 @@
################
### MONITORS ###
################
# See https://wiki.hyprland.org/Configuring/Monitors/
monitor=Virtual-1,1920x1080,0x0,1
workspace = 1, monitor:Virtual-1
workspace = 2, monitor:Virtual-1
workspace = 3, monitor:Virtual-1
workspace = 4, monitor:Virtual-1
workspace = 5, monitor:Virtual-1
workspace = 6, monitor:Virtual-1
workspace = 7, monitor:Virtual-1
workspace = 8, monitor:Virtual-1

View File

@@ -15,7 +15,7 @@
Shutdown\0icon\x1fsystem-shutdown Shutdown\0icon\x1fsystem-shutdown
Reboot\0icon\x1fsystem-reboot Reboot\0icon\x1fsystem-reboot
Exit hyprland\0icon\x1fsystem-log-out Exit hyprland\0icon\x1fsystem-log-out
Reload hyprland\0icon\x1fsystem-log-out" | ${pkgs.rofi-wayland}/bin/rofi -dmenu -show-icons -i -theme /etc/xdg/rofi/disconnect.rasi -p System) Reload hyprland\0icon\x1fsystem-log-out" | ${pkgs.rofi}/bin/rofi -dmenu -show-icons -i -theme /etc/xdg/rofi/disconnect.rasi -p System)
echo "$selected" echo "$selected"
@@ -56,7 +56,7 @@
_LINES="$(curl "http://10.0.0.1:2013/$1" 2>/dev/null | sed -e "s|.*<a href=\"\([^\"]*\).*|$1\1|" -e "s/.*<.*\|.*C=D.*\|.*\/\/$\|.*.nfo//" -e "/^$/d")" _LINES="$(curl "http://10.0.0.1:2013/$1" 2>/dev/null | sed -e "s|.*<a href=\"\([^\"]*\).*|$1\1|" -e "s/.*<.*\|.*C=D.*\|.*\/\/$\|.*.nfo//" -e "/^$/d")"
fi fi
_RESULT=$(${pkgs.rofi-wayland}/bin/rofi -dmenu -config /etc/xdg/rofi/config.rasi -i <<< "$_LINES") _RESULT=$(${pkgs.rofi}/bin/rofi -dmenu -config /etc/xdg/rofi/config.rasi -i <<< "$_LINES")
# If no output # If no output
echo "$_RESULT" echo "$_RESULT"

View File

@@ -9,7 +9,7 @@
environment.systemPackages = [ environment.systemPackages = [
pkgs.wl-clipboard pkgs.wl-clipboard
pkgs.rofi-wayland pkgs.rofi
pkgs.waybar pkgs.waybar
pkgs.font-awesome pkgs.font-awesome
pkgs.hyprlock pkgs.hyprlock

View File

@@ -0,0 +1,19 @@
{
...
}:
{
imports = [
../sops-desktop.nix
../sudo-nopasswd.nix
../autologin.nix
../ssh.nix
### Import GUI modules
../desktop/dunst.nix
../desktop/kitty.nix
../desktop/packages.nix
../desktop/qwerty-fr.nix
../desktop/rofi.nix
../desktop/wayland.nix
];
}