ADD: terre-neuvas server
This commit is contained in:
parent
e0a82ee731
commit
4f411004e6
12 changed files with 247 additions and 25 deletions
51
flake.lock
generated
51
flake.lock
generated
|
|
@ -3,7 +3,7 @@
|
||||||
"home-manager": {
|
"home-manager": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs-unstable"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
|
|
@ -20,13 +20,50 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"home-manager-stable": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs-stable"
|
||||||
|
]
|
||||||
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1756892917,
|
"lastModified": 1756679287,
|
||||||
"narHash": "sha256-hVsGRW6M3Rd2xSlKowNREyVHXCUbxHoktu1ujgxT4x8=",
|
"narHash": "sha256-Xd1vOeY9ccDf5VtVK12yM0FS6qqvfUop8UQlxEB+gTQ=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"rev": "07fc025fe10487dd80f2ec694f1cd790e752d0e8",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"ref": "release-25.05",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs-stable": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1756886854,
|
||||||
|
"narHash": "sha256-6tooT142NLcFjt24Gi4B0G1pgWLvfw7y93sYEfSHlLI=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "3f29c71a26f20c830b3708d02bfa62fb1890354a",
|
"rev": "0e6684e6c5755325f801bda1751a8a4038145d7d",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixos-25.05",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs-unstable": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1756936398,
|
||||||
|
"narHash": "sha256-/o1TTpMIICpjrMHBilL9lYm/r69uhdK1L8j1pfY6tWU=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "47f28ad9378956563df9a884fd1b209b64336ba3",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -39,7 +76,9 @@
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"nixpkgs": "nixpkgs"
|
"home-manager-stable": "home-manager-stable",
|
||||||
|
"nixpkgs-stable": "nixpkgs-stable",
|
||||||
|
"nixpkgs-unstable": "nixpkgs-unstable"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
33
flake.nix
33
flake.nix
|
|
@ -2,35 +2,52 @@
|
||||||
description = "My nixos config with WM switch capacity";
|
description = "My nixos config with WM switch capacity";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
|
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-25.05";
|
||||||
|
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable-small";
|
||||||
|
home-manager-stable = {
|
||||||
|
url = "github:nix-community/home-manager/release-25.05";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs-stable";
|
||||||
|
};
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager";
|
url = "github:nix-community/home-manager";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = {
|
outputs = {
|
||||||
nixpkgs,
|
nixpkgs-stable,
|
||||||
|
nixpkgs-unstable,
|
||||||
|
home-manager-stable,
|
||||||
home-manager,
|
home-manager,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
# --- Host NixOS (x86_64) ---
|
# --- Host NixOS (x86_64) ---
|
||||||
nixosConfigurations.pennsardin = nixpkgs.lib.nixosSystem {
|
nixosConfigurations = {
|
||||||
system = "x86_64-linux";
|
pennsardin = nixpkgs-unstable.lib.nixosSystem {
|
||||||
modules = [
|
system = "x86_64-linux";
|
||||||
|
modules = [
|
||||||
./hosts/pennsardin/configuration.nix
|
./hosts/pennsardin/configuration.nix
|
||||||
home-manager.nixosModules.home-manager
|
home-manager.nixosModules.home-manager
|
||||||
# L'utilisateur HM est déclaré dans hosts/pennsardin/configuration.nix
|
# L'utilisateur HM est déclaré dans hosts/pennsardin/configuration.nix
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
terre-neuvas = nixpkgs-stable.lib.nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
modules = [
|
||||||
|
./hosts/terre-neuvas/configuration.nix
|
||||||
|
home-manager-stable.nixosModules.home-manager
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# --- DevShell (x86_64 uniquement) ---
|
# --- DevShell (x86_64 uniquement) ---
|
||||||
devShells.x86_64-linux.default = import ./devshell.nix {
|
devShells.x86_64-linux.default = import ./devshell.nix {
|
||||||
pkgs = import nixpkgs {system = "x86_64-linux";};
|
pkgs = import nixpkgs-stable {system = "x86_64-linux";};
|
||||||
};
|
};
|
||||||
|
|
||||||
# --- Formatter (x86_64 uniquement) ---
|
# --- Formatter (x86_64 uniquement) ---
|
||||||
formatter.x86_64-linux =
|
formatter.x86_64-linux =
|
||||||
(import nixpkgs {system = "x86_64-linux";}).alejandra;
|
(import nixpkgs-stable {system = "x86_64-linux";}).alejandra;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
9
hm/common/git.nix
Normal file
9
hm/common/git.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
_: {
|
||||||
|
programs.git = {
|
||||||
|
enable = true;
|
||||||
|
userName = "L0m1g" ;
|
||||||
|
userEmail = "git@lomig.me";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
# vim: set ts=2 sw=2 sts=2 et :
|
||||||
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
# hm/desktop/bspwm.nix
|
# hm/desktop/bspwm.nix
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
|
imports = [
|
||||||
|
../common/browser.nix
|
||||||
|
];
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
bspwm sxhkd xorg.xinit xterm alacritty rofi feh font-awesome
|
bspwm sxhkd xorg.xinit xterm alacritty rofi feh font-awesome
|
||||||
picom xorg.xset xidlehook betterlockscreen pywal16 imagemagick
|
picom xorg.xset xidlehook betterlockscreen pywal16 imagemagick
|
||||||
|
|
@ -20,7 +23,6 @@
|
||||||
"setxkbmap bepovim"
|
"setxkbmap bepovim"
|
||||||
"xrandr --output DisplayPort-1 --rate 60 --pos 0x0"
|
"xrandr --output DisplayPort-1 --rate 60 --pos 0x0"
|
||||||
"while pgrep -x polybar >/dev/null; do sleep 0.2; done; polybar main"
|
"while pgrep -x polybar >/dev/null; do sleep 0.2; done; polybar main"
|
||||||
# fond d’écran (feh)
|
|
||||||
"bash ~/.fehbg"
|
"bash ~/.fehbg"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -32,7 +34,6 @@
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
# Réglages X (corrigé : c'était 'xsession s noblank' -> 'xset s noblank')
|
|
||||||
xsession.initExtra = ''
|
xsession.initExtra = ''
|
||||||
xset s 300 300
|
xset s 300 300
|
||||||
xset s on
|
xset s on
|
||||||
|
|
@ -41,7 +42,6 @@
|
||||||
xset dpms 0 0 500
|
xset dpms 0 0 500
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# sxhkd
|
|
||||||
services.sxhkd = {
|
services.sxhkd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
extraOptions = [ "-m" "1" ];
|
extraOptions = [ "-m" "1" ];
|
||||||
|
|
|
||||||
18
hm/users/lomig-desktop.nix
Normal file
18
hm/users/lomig-desktop.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
{pkgs, ...}: {
|
||||||
|
imports = [
|
||||||
|
../desktop/bspwm.nix
|
||||||
|
./lomig.nix
|
||||||
|
];
|
||||||
|
home.stateVersion = "25.05"; # ou ton actuelle
|
||||||
|
home = {
|
||||||
|
packages = with pkgs; [
|
||||||
|
fastfetch
|
||||||
|
nerd-fonts.iosevka
|
||||||
|
obsidian
|
||||||
|
smug
|
||||||
|
telegram-desktop
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
# vim: set ts=2 sw=2 sts=2 et :
|
||||||
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
{pkgs, ...}: {
|
{pkgs, ...}: {
|
||||||
imports = [
|
imports = [
|
||||||
../../hm/common/browser.nix
|
|
||||||
../common/nvim.nix
|
../common/nvim.nix
|
||||||
|
../../hm/common/git.nix
|
||||||
../../hm/common/zsh.nix
|
../../hm/common/zsh.nix
|
||||||
../desktop/bspwm.nix
|
|
||||||
];
|
];
|
||||||
home.stateVersion = "25.05"; # ou ton actuelle
|
home.stateVersion = "25.05"; # ou ton actuelle
|
||||||
home = {
|
home = {
|
||||||
|
|
@ -11,11 +10,6 @@
|
||||||
homeDirectory = "/home/lomig";
|
homeDirectory = "/home/lomig";
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
bat
|
bat
|
||||||
fastfetch
|
|
||||||
nerd-fonts.iosevka
|
|
||||||
obsidian
|
|
||||||
smug
|
|
||||||
telegram-desktop
|
|
||||||
tree
|
tree
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
useGlobalPkgs = true;
|
useGlobalPkgs = true;
|
||||||
users.lomig = import ../../hm/users/lomig.nix;
|
users.lomig = import ../../hm/users/lomig-desktop.nix;
|
||||||
};
|
};
|
||||||
|
|
||||||
system.stateVersion = "25.05"; # pour éviter les hurlements inutiles
|
system.stateVersion = "25.05"; # pour éviter les hurlements inutiles
|
||||||
|
|
|
||||||
54
hosts/terre-neuvas/configuration.nix
Normal file
54
hosts/terre-neuvas/configuration.nix
Normal file
|
|
@ -0,0 +1,54 @@
|
||||||
|
# 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/caddy.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
# Bootloader.
|
||||||
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
||||||
|
networking.hostName = "terre-neuvas"; # Define your hostname.
|
||||||
|
networking.networkmanager.enable = true;
|
||||||
|
|
||||||
|
# Configure keymap in X11
|
||||||
|
services.xserver.xkb = {
|
||||||
|
layout = "fr";
|
||||||
|
variant = "azerty";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Configure console keymap
|
||||||
|
console.keyMap = "fr";
|
||||||
|
|
||||||
|
users.users.lomig = {
|
||||||
|
isNormalUser = true;
|
||||||
|
extraGroups = ["networkmanager" "lp" "wheel"];
|
||||||
|
shell = pkgs.zsh;
|
||||||
|
};
|
||||||
|
|
||||||
|
home-manager = {
|
||||||
|
useGlobalPkgs = true;
|
||||||
|
users.lomig = import ../../hm/users/lomig.nix;
|
||||||
|
};
|
||||||
|
|
||||||
|
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
|
||||||
|
];
|
||||||
|
|
||||||
|
networking.firewall.allowedTCPPorts = [ 80 ];
|
||||||
|
system.stateVersion = "25.05"; # Did you read the comment?
|
||||||
|
}
|
||||||
41
hosts/terre-neuvas/hardware.nix
Normal file
41
hosts/terre-neuvas/hardware.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
# 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")
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
fileSystems."/" =
|
||||||
|
{ device = "/dev/disk/by-uuid/f37e4afb-1ee2-4f70-a93c-398461405181";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/boot" =
|
||||||
|
{ device = "/dev/disk/by-uuid/111D-E5E8";
|
||||||
|
fsType = "vfat";
|
||||||
|
options = [ "fmask=0077" "dmask=0077" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
}
|
||||||
19
modules/roles/server.nix
Normal file
19
modules/roles/server.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
{pkgs, ...}: {
|
||||||
|
imports = [
|
||||||
|
../common/nix.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
git
|
||||||
|
wget
|
||||||
|
curl
|
||||||
|
ripgrep
|
||||||
|
fd
|
||||||
|
pciutils
|
||||||
|
usbutils
|
||||||
|
p7zip
|
||||||
|
gdu
|
||||||
|
glances
|
||||||
|
tmux
|
||||||
|
];
|
||||||
|
}
|
||||||
13
modules/services/caddy.nix
Normal file
13
modules/services/caddy.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
_: {
|
||||||
|
services.caddy = {
|
||||||
|
enable = true;
|
||||||
|
virtualHosts."blog.lomig.me" = {
|
||||||
|
extraConfig = ''
|
||||||
|
root * /var/www/lomig
|
||||||
|
file_server
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||||
|
}
|
||||||
18
profiles/server-selfhosted.nix
Normal file
18
profiles/server-selfhosted.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
{pkgs, ...}: {
|
||||||
|
imports = [
|
||||||
|
../modules/roles/server.nix
|
||||||
|
../modules/common/base.nix
|
||||||
|
../modules/common/networking.nix
|
||||||
|
../modules/services/printing.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
services.openssh.enable = true;
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
btrfs-progs
|
||||||
|
cifs-utils
|
||||||
|
lm_sensors
|
||||||
|
];
|
||||||
|
}
|
||||||
|
# vim: set ts=2 sw=2 sts=2 et :
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue