commit d4ca1cffd21612696134bde70998d4c637669499 Author: Henri Saudubray Date: Tue Dec 16 11:12:12 2025 +0100 chore: init repo diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..e6181ff --- /dev/null +++ b/flake.lock @@ -0,0 +1,49 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1765605144, + "narHash": "sha256-RM2xs+1HdHxesjOelxoA3eSvXShC8pmBvtyTke4Ango=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "90b62096f099b73043a747348c11dbfcfbdea949", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-25.11", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1765762245, + "narHash": "sha256-3iXM/zTqEskWtmZs3gqNiVtRTsEjYAedIaLL0mSBsrk=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "c8cfcd6ccd422e41cc631a0b73ed4d5a925c393d", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-25.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..8fc4401 --- /dev/null +++ b/flake.nix @@ -0,0 +1,23 @@ +{ + description = "hms' nixos configuration"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11"; + home-manager.url = "github:nix-community/home-manager/release-25.11"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + }; + + outputs = { nixpkgs, home-manager, ... }: { + nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./nixos/configuration.nix + home-manager.nixosModules.home-manager { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.hms = ./home-manager/home.nix; + } + ]; + }; + }; +} diff --git a/home-manager/home.nix b/home-manager/home.nix new file mode 100644 index 0000000..38d1890 --- /dev/null +++ b/home-manager/home.nix @@ -0,0 +1,89 @@ +{ config, pkgs, ... }: + +{ + home = { + username = "hms"; + homeDirectory = "/home/hms"; + packages = with pkgs; [ + # Utilities + neofetch + zip + xz + unzip + ripgrep + just + tealdeer + + # Applications + zotero + zulip + discord + signal-desktop + sgt-puzzles + gapless + + # Development + opam + tinymist + nixfmt-rfc-style + ]; + + shell.enableBashIntegration = true; + shellAliases = { + ":q" = "exit"; + "h" = "hx"; + "o" = "xdg-open"; + }; + + stateVersion = "25.11"; + }; + + programs = { + home-manager.enable = true; + helix = { + enable = true; + defaultEditor = true; + settings = { + theme = "adwaita-dark"; + editor = { + lsp.display-messages = true; + inline-diagnostics.cursor-line = "info"; + rulers = [81]; + }; + }; + }; + bat.enable = true; + git = { + enable = true; + settings = { + user = { + email = "henri.saudubray@proton.me"; + name = "Henri Saudubray"; + }; + init.defaultBranch = "main"; + }; + signing.format = "openpgp"; + }; + bash = { + enable = true; + bashrcExtra = '' + export PS1=" \W \[\e[33m\]λ\[\e[0m\] " + test -r '/home/hms/.opam/opam-init/init.sh' && . '/home/hms/.opam/opam-init/init.sh' > /dev/null 2> /dev/null || true + ''; + }; + gpg.enable = true; + }; + + xdg.userDirs = { + enable = true; + createDirectories = true; + desktop = "${config.home.homeDirectory}/dsk"; + documents = "${config.home.homeDirectory}/doc"; + download = "${config.home.homeDirectory}/dwn"; + music = "${config.home.homeDirectory}/aud"; + pictures = "${config.home.homeDirectory}/img"; + publicShare = "${config.home.homeDirectory}/pub"; + templates = "${config.home.homeDirectory}/tpl"; + videos = "${config.home.homeDirectory}/vid"; + }; +} diff --git a/justfile b/justfile new file mode 100644 index 0000000..5bc69dc --- /dev/null +++ b/justfile @@ -0,0 +1,4 @@ +build: + sudo cp -r * /etc/nixos + sudo nixos-rebuild switch + sudo cp /etc/nixos/flake.lock . diff --git a/nixos/configuration.nix b/nixos/configuration.nix new file mode 100644 index 0000000..69ef286 --- /dev/null +++ b/nixos/configuration.nix @@ -0,0 +1,133 @@ +# 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, ... }: + +{ + imports = + [ + ./hardware-configuration.nix + ]; + + # Use flakes. + nix.settings.experimental-features = "nix-command flakes"; + + # Bootloader. + boot = { + loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + kernelPackages = pkgs.linuxPackages_latest; + initrd.luks.devices."luks-374c6259-18c4-462b-9f30-9c9648de00ae".device = "/dev/disk/by-uuid/374c6259-18c4-462b-9f30-9c9648de00ae"; + }; + + networking = { + hostName = "nixos"; + networkmanager.enable = true; + wireless.networks.eduroam = { + auth = '' + key_mgmt=WPA-EAP + eap=PWD + identity="henri.saudubray@universite-paris-saclay.fr" + password="" + ''; + }; + }; + + # Set your time zone. + time.timeZone = "Europe/Paris"; + + # Select internationalisation properties. + i18n = { + defaultLocale = "en_GB.UTF-8"; + extraLocaleSettings = { + LC_ADDRESS = "fr_FR.UTF-8"; + LC_IDENTIFICATION = "fr_FR.UTF-8"; + LC_MEASUREMENT = "fr_FR.UTF-8"; + LC_MONETARY = "fr_FR.UTF-8"; + LC_NAME = "fr_FR.UTF-8"; + LC_NUMERIC = "fr_FR.UTF-8"; + LC_PAPER = "fr_FR.UTF-8"; + LC_TELEPHONE = "fr_FR.UTF-8"; + LC_TIME = "fr_FR.UTF-8"; + }; + }; + + services = { + xserver = { + # Use X11. + enable = true; + # Set keyboard layout in X11. + xkb = { + layout = "fr"; + variant = "ergol"; + }; + }; + # Use GNOME. + displayManager.gdm.enable = true; + desktopManager.gnome.enable = true; + # Use CUPS for printing. + printing.enable = true; + # Use pipewire for audio. + pulseaudio.enable = false; + pipewire = { + enable = true; + alsa = { + enable = true; + support32Bit = true; + }; + pulse.enable = true; + }; + openssh.enable = true; + }; + + # Configure console keymap. + console.keyMap = "fr"; + + # Define a user account. + users.users.hms = { + isNormalUser = true; + description = "hms"; + extraGroups = [ "networkmanager" "wheel" ]; + packages = with pkgs; []; + }; + + # Install firefox. + programs.firefox.enable = true; + + nixpkgs = { + overlays = []; + # Allow unfree packages + config.allowUnfree = true; + }; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + helix + wget + gnome-tweaks + gnomeExtensions.blur-my-shell + gnomeExtensions.clipboard-indicator + gnomeExtensions.rounded-window-corners-reborn + gnomeExtensions.runcat + nerd-fonts.caskaydia-cove + adw-gtk3 + gnumake + clang + just + xclip + ]; + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; + + system.stateVersion = "25.11"; # Did you read the comment? +} diff --git a/nixos/hardware-configuration.nix b/nixos/hardware-configuration.nix new file mode 100644 index 0000000..474c3e4 --- /dev/null +++ b/nixos/hardware-configuration.nix @@ -0,0 +1,35 @@ +# 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" "thunderbolt" "vmd" "nvme" "usb_storage" "usbhid" "sd_mod" "rtsx_pci_sdmmc" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/mapper/luks-de976821-5bfe-4c34-92ff-5d4d607e42c4"; + fsType = "ext4"; + }; + + boot.initrd.luks.devices."luks-de976821-5bfe-4c34-92ff-5d4d607e42c4".device = "/dev/disk/by-uuid/de976821-5bfe-4c34-92ff-5d4d607e42c4"; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/6137-E7B4"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = + [ { device = "/dev/mapper/luks-374c6259-18c4-462b-9f30-9c9648de00ae"; } + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}