CLEAN: nix develop

This commit is contained in:
DuN0z 2025-10-05 08:20:57 +02:00
parent daeb15f821
commit c495445e91
22 changed files with 439 additions and 423 deletions

View file

@ -1,67 +1,70 @@
{ config, pkgs, ...}:
{
boot.loader.grub = {
enable = true ;
device = "/dev/vda";
};
fileSystems."/" = {
device = "/dev/vda1" ;
fsType = "ext4" ;
};
fileSystems."/srv" = {
device = "shared0" ;
fsType = "9p" ;
options = [ "trans=virtio" "version=9p2000.L" "rw" ];
neededForBoot = false ;
noCheck = true ;
};
systemd.services.mountShared = {
description = "Mount 9p shared folder" ;
after = [ "local-fs.target" "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "oneshot" ;
ExecStart = "${pkgs.util-linux}/bin/mount -t 9p -o trans=virtio,version=9p2000.L shared0 /srv";
RemainAfterExit = true ;
{pkgs, ...}: {
boot = {
kernelPackages = pkgs.linuxPackages;
initrd.supportedFilesystems = ["ext4"];
loader.grub = {
enable = true;
device = "/dev/vda";
};
};
boot.kernelPackages = pkgs.linuxPackages ;
boot.initrd.supportedFilesystems = [ "ext4" ];
fileSystems = {
"/" = {
device = "/dev/vda1";
fsType = "ext4";
};
"/srv" = {
device = "shared0";
fsType = "9p";
options = ["trans=virtio" "version=9p2000.L" "rw"];
neededForBoot = false;
noCheck = true;
};
};
networking = {
useDHCP = true;
useNetworkd = true ;
hostName = "forbann" ;
useNetworkd = true;
hostName = "forbann";
};
systemd.network = {
enable = true ;
networks."10-eth0" = {
matchConfig.Name = "eth0";
networkConfig = {
Address = "192.168.1.10/24";
Gateway = "192.168.0.254" ;
DNS = "192.168.0.254" ;
systemd = {
services.mountShared = {
description = "Mount 9p shared folder";
after = ["local-fs.target" "network.target"];
wantedBy = ["multi-user.target"];
serviceConfig = {
Type = "oneshot";
ExecStart = "${pkgs.util-linux}/bin/mount -t 9p -o trans=virtio,version=9p2000.L shared0 /srv";
RemainAfterExit = true;
};
};
network = {
enable = true;
networks."10-eth0" = {
matchConfig.Name = "eth0";
networkConfig = {
Address = "192.168.1.10/24";
Gateway = "192.168.0.254";
DNS = "192.168.0.254";
};
};
};
};
services.openssh.enable = true ;
services.rtorrent = {
enable = true ;
dataDir = "/home/vmuser/torrents" ;
services = {
openssh.enable = true;
rtorrent = {
enable = true;
dataDir = "/home/vmuser/torrents";
};
};
users.users.vmuser = {
isNormalUser = true ;
extraGroups = [ "wheel" ];
password = "changeme" ;
isNormalUser = true;
extraGroups = ["wheel"];
password = "changeme";
};
system.stateVersion = "25.05" ;
system.stateVersion = "25.05";
}

View file

@ -8,34 +8,31 @@
networking.hostName = "pennsardin";
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.swraid.enable = true ;
boot.swraid.enable = true;
fileSystems."/" =
{ device = "/dev/disk/by-uuid/b1a1ae71-4277-45d5-a3d2-f49354f263d4";
fsType = "ext4";
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/b1a1ae71-4277-45d5-a3d2-f49354f263d4";
fsType = "ext4";
};
"/boot" = {
device = "/dev/disk/by-uuid/1DB2-7A0F";
fsType = "vfat";
options = ["fmask=0077" "dmask=0077"];
};
"/proc" = {
device = "proc";
fsType = "proc";
options = ["defaults" "hidepid=2"];
neededForBoot = true;
};
"/srv/raid" = {
device = "/dev/disk/by-uuid/85f72160-4720-463a-9dc6-7c5216733f2b";
fsType = "btrfs";
};
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/1DB2-7A0F";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
fileSystems."/proc" =
{
device = "proc" ;
fsType = "proc" ;
options = [ "defaults" "hidepid=2" ];
neededForBoot = true ;
};
fileSystems."/srv/raid" =
{ device = "/dev/disk/by-uuid/85f72160-4720-463a-9dc6-7c5216733f2b";
fsType = "btrfs";
};
swapDevices = [ ];
swapDevices = [];
users.users.lomig = {
isNormalUser = true;
@ -49,27 +46,27 @@
};
networking = {
useNetworkd = true ;
firewall.allowedTCPPorts = [ 22 80 5900 5901 5902 ];
interfaces.enp11s0.useDHCP = false ;
useNetworkd = true;
firewall.allowedTCPPorts = [22 80 5900 5901 5902];
interfaces.enp11s0.useDHCP = false;
interfaces.br0 = {
useDHCP = false ;
useDHCP = false;
ipv4.addresses = [
{
address = "192.168.0.2";
prefixLength = 24 ;
prefixLength = 24;
}
];
};
defaultGateway = {
interface = "br0" ;
address = "192.168.0.254" ;
interface = "br0";
address = "192.168.0.254";
};
nameservers = [ "192.168.0.254" "1.1.1.1" ];
bridges.br0.interfaces = [ "enp11s0" ];
nameservers = ["192.168.0.254" "1.1.1.1"];
bridges.br0.interfaces = ["enp11s0"];
};
systemd.network = {
enable = true ;
enable = true;
netdevs."br0" = {
netdevConfig = {
Name = "br0";
@ -77,7 +74,7 @@
};
};
networks."br0" = {
matchConfig.Name = "br0" ;
matchConfig.Name = "br0";
};
networks."enp11s0" = {
matchConfig.Name = "enp11s0";
@ -87,6 +84,5 @@
system.stateVersion = "25.05"; # pour éviter les hurlements inutiles
}
# vim: set ts=2 sw=2 sts=2 et :

View file

@ -1,19 +1,19 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }:
{
nix.settings.experimental-features = ["nix-command" "flakes" ];
imports =
[ # Include the results of the hardware scan.
./hardware.nix
../../profiles/server-selfhosted.nix
../../modules/services/ftp.nix
../../modules/services/forgejo.nix
];
config,
pkgs,
...
}: {
nix.settings.experimental-features = ["nix-command" "flakes"];
imports = [
# Include the results of the hardware scan.
./hardware.nix
../../profiles/server-selfhosted.nix
../../modules/services/ftp.nix
../../modules/services/forgejo.nix
];
# Bootloader.
boot.loader.systemd-boot.enable = true;
@ -32,7 +32,7 @@
users.users.lomig = {
isNormalUser = true;
extraGroups = [ "lp" "wheel" "docker" ];
extraGroups = ["lp" "wheel" "docker"];
shell = pkgs.zsh;
};
@ -44,32 +44,32 @@
nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [
neovim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
git
hugo
neovim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
git
hugo
];
networking = {
useNetworkd = true ;
firewall.allowedTCPPorts = [ 22 80 5900 5901 5902 ];
interfaces.eno1.useDHCP = false ;
useNetworkd = true;
firewall.allowedTCPPorts = [22 80 5900 5901 5902];
interfaces.eno1.useDHCP = false;
interfaces.br0 = {
useDHCP = false ;
useDHCP = false;
ipv4.addresses = [
{
address = "192.168.0.3";
prefixLength = 24 ;
prefixLength = 24;
}
];
};
defaultGateway = {
interface = "br0" ;
address = "192.168.0.254" ;
interface = "br0";
address = "192.168.0.254";
};
nameservers = [ "192.168.0.254" "1.1.1.1" ];
bridges.br0.interfaces = [ "eno1" ];
nameservers = ["192.168.0.254" "1.1.1.1"];
bridges.br0.interfaces = ["eno1"];
};
systemd.network = {
enable = true ;
enable = true;
netdevs."br0" = {
netdevConfig = {
Name = "br0";
@ -77,7 +77,7 @@
};
};
networks."br0" = {
matchConfig.Name = "br0" ;
matchConfig.Name = "br0";
};
networks."eno1" = {
matchConfig.Name = "eno1";

View file

@ -1,45 +1,42 @@
# 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")
];
config,
lib,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = lib.mkAfter [ "kvm-intel" "tun" ];
boot.extraModulePackages = [ ];
boot = {
initrd.availableKernelModules = ["xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"];
initrd.kernelModules = [];
kernelModules = lib.mkAfter ["kvm-intel" "tun"];
extraModulePackages = [];
};
fileSystems."/" =
{ device = "/dev/disk/by-uuid/f37e4afb-1ee2-4f70-a93c-398461405181";
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/f37e4afb-1ee2-4f70-a93c-398461405181";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/111D-E5E8";
"/boot" = {
device = "/dev/disk/by-uuid/111D-E5E8";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
options = ["fmask=0077" "dmask=0077"];
};
fileSystems."/srv" =
{ device = "/dev/disk/by-uuid/2ef442a9-0eab-4dc5-b17c-076e18a54873";
"/srv" = {
device = "/dev/disk/by-uuid/2ef442a9-0eab-4dc5-b17c-076e18a54873";
fsType = "btrfs";
};
};
swapDevices =
[ { device = "/dev/disk/by-uuid/c3a69154-ead9-4fcc-a9b1-3b741a42ee97"; }
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
# networking.useDHCP = lib.mkDefault true;
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true;
swapDevices = [
{device = "/dev/disk/by-uuid/c3a69154-ead9-4fcc-a9b1-3b741a42ee97";}
];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;