Initial nixos configuration
This commit is contained in:
		
							parent
							
								
									35f4a8026e
								
							
						
					
					
						commit
						7ac5d06c18
					
				
							
								
								
									
										7
									
								
								flake.lock
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										7
									
								
								flake.lock
									
									
									
										generated
									
									
									
								
							@ -25,15 +25,16 @@
 | 
			
		||||
        ]
 | 
			
		||||
      },
 | 
			
		||||
      "locked": {
 | 
			
		||||
        "lastModified": 1745627989,
 | 
			
		||||
        "narHash": "sha256-mOCdFmxocBPae7wg7RYWOtJzWMJk34u9493ItY0dVqw=",
 | 
			
		||||
        "lastModified": 1746171682,
 | 
			
		||||
        "narHash": "sha256-EyXUNSa+H+YvGVuQJP1nZskXAowxKYp79RNUsNdQTj4=",
 | 
			
		||||
        "owner": "nix-community",
 | 
			
		||||
        "repo": "home-manager",
 | 
			
		||||
        "rev": "4d2d32231797bfa7213ae5e8ac89d25f8caaae82",
 | 
			
		||||
        "rev": "50eee705bbdbac942074a8c120e8194185633675",
 | 
			
		||||
        "type": "github"
 | 
			
		||||
      },
 | 
			
		||||
      "original": {
 | 
			
		||||
        "owner": "nix-community",
 | 
			
		||||
        "ref": "release-24.11",
 | 
			
		||||
        "repo": "home-manager",
 | 
			
		||||
        "type": "github"
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										64
									
								
								flake.nix
									
									
									
									
									
								
							
							
						
						
									
										64
									
								
								flake.nix
									
									
									
									
									
								
							@ -4,46 +4,48 @@
 | 
			
		||||
  inputs = {
 | 
			
		||||
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
 | 
			
		||||
 | 
			
		||||
    home-manager.url = "github:nix-community/home-manager";
 | 
			
		||||
    home-manager.url = "github:nix-community/home-manager/release-24.11";
 | 
			
		||||
    home-manager.inputs.nixpkgs.follows = "nixpkgs";
 | 
			
		||||
 | 
			
		||||
    nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions";
 | 
			
		||||
    nix-vscode-extensions.inputs.nixpkgs.follows = "nixpkgs";
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  outputs = inputs: let
 | 
			
		||||
    inherit (inputs.nixpkgs) lib;
 | 
			
		||||
  outputs =
 | 
			
		||||
    inputs:
 | 
			
		||||
    let
 | 
			
		||||
      inherit (inputs.nixpkgs) lib;
 | 
			
		||||
 | 
			
		||||
    mkNixosSystems = lib.mapAttrs (
 | 
			
		||||
      name: modules:
 | 
			
		||||
      mkNixosSystems = lib.mapAttrs (
 | 
			
		||||
        name: modules:
 | 
			
		||||
        lib.nixosSystem {
 | 
			
		||||
          modules =
 | 
			
		||||
            modules
 | 
			
		||||
            ++ [
 | 
			
		||||
              {
 | 
			
		||||
                networking.hostName = name;
 | 
			
		||||
                nixpkgs.overlays = [inputs.nix-vscode-extensions.overlays.default];
 | 
			
		||||
              }
 | 
			
		||||
            ];
 | 
			
		||||
          specialArgs = {inherit inputs;};
 | 
			
		||||
          modules = modules ++ [
 | 
			
		||||
            {
 | 
			
		||||
              imports = [ (import "${inputs.home-manager}/nixos") ];
 | 
			
		||||
              networking.hostName = name;
 | 
			
		||||
              nixpkgs.overlays = [ inputs.nix-vscode-extensions.overlays.default ];
 | 
			
		||||
            }
 | 
			
		||||
          ];
 | 
			
		||||
          specialArgs = { inherit inputs; };
 | 
			
		||||
        }
 | 
			
		||||
    );
 | 
			
		||||
  in {
 | 
			
		||||
    formatter.x86_64-linux = inputs.nixpkgs.legacyPackages.x86_64-linux.alejandra;
 | 
			
		||||
      );
 | 
			
		||||
    in
 | 
			
		||||
    {
 | 
			
		||||
      formatter.x86_64-linux = inputs.nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style;
 | 
			
		||||
 | 
			
		||||
    nixosConfigurations = mkNixosSystems {
 | 
			
		||||
      polysaa = [
 | 
			
		||||
        ./machines/polysaa
 | 
			
		||||
        ./profiles/graphical
 | 
			
		||||
      ];
 | 
			
		||||
      mynspiron = [
 | 
			
		||||
        ./machines/mynspiron
 | 
			
		||||
        ./profiles/graphical
 | 
			
		||||
      ];
 | 
			
		||||
      myssian = [
 | 
			
		||||
        ./machines/myssian
 | 
			
		||||
        ./profiles/graphical
 | 
			
		||||
      ];
 | 
			
		||||
      nixosConfigurations = mkNixosSystems {
 | 
			
		||||
        polysaa = [
 | 
			
		||||
          ./machines/polysaa
 | 
			
		||||
          ./profiles/graphical
 | 
			
		||||
        ];
 | 
			
		||||
        mynspiron = [
 | 
			
		||||
          ./machines/mynspiron
 | 
			
		||||
          ./profiles/graphical
 | 
			
		||||
        ];
 | 
			
		||||
        myssian = [
 | 
			
		||||
          ./machines/myssian
 | 
			
		||||
          ./profiles/graphical
 | 
			
		||||
        ];
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -7,16 +7,25 @@
 | 
			
		||||
  pkgs,
 | 
			
		||||
  modulesPath,
 | 
			
		||||
  ...
 | 
			
		||||
}: {
 | 
			
		||||
}:
 | 
			
		||||
{
 | 
			
		||||
  imports = [
 | 
			
		||||
    (modulesPath + "/installer/scan/not-detected.nix")
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
  boot.initrd.availableKernelModules = ["xhci_pci" "thunderbolt" "nvme" "usbhid" "usb_storage" "sd_mod"];
 | 
			
		||||
  boot.initrd.kernelModules = ["dm-snapshot"];
 | 
			
		||||
  boot.initrd.luks.devices.cryptroot.device = "/dev/disk/by-uuid/c75f2769-d32f-4eed-9237-ece7e783fec3";
 | 
			
		||||
  boot.kernelModules = ["kvm-intel"];
 | 
			
		||||
  boot.extraModulePackages = [];
 | 
			
		||||
  boot.initrd.availableKernelModules = [
 | 
			
		||||
    "xhci_pci"
 | 
			
		||||
    "thunderbolt"
 | 
			
		||||
    "nvme"
 | 
			
		||||
    "usbhid"
 | 
			
		||||
    "usb_storage"
 | 
			
		||||
    "sd_mod"
 | 
			
		||||
  ];
 | 
			
		||||
  boot.initrd.kernelModules = [ "dm-snapshot" ];
 | 
			
		||||
  boot.initrd.luks.devices.cryptroot.device =
 | 
			
		||||
    "/dev/disk/by-uuid/c75f2769-d32f-4eed-9237-ece7e783fec3";
 | 
			
		||||
  boot.kernelModules = [ "kvm-intel" ];
 | 
			
		||||
  boot.extraModulePackages = [ ];
 | 
			
		||||
  boot.loader.systemd-boot.enable = true;
 | 
			
		||||
 | 
			
		||||
  fileSystems."/" = {
 | 
			
		||||
@ -27,11 +36,14 @@
 | 
			
		||||
  fileSystems."/boot" = {
 | 
			
		||||
    device = "/dev/disk/by-uuid/6B09-29A2";
 | 
			
		||||
    fsType = "vfat";
 | 
			
		||||
    options = ["fmask=0022" "dmask=0022"];
 | 
			
		||||
    options = [
 | 
			
		||||
      "fmask=0022"
 | 
			
		||||
      "dmask=0022"
 | 
			
		||||
    ];
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  swapDevices = [
 | 
			
		||||
    {device = "/dev/disk/by-uuid/77ed2d48-365d-4a61-8ada-509e8b7a744c";}
 | 
			
		||||
    { device = "/dev/disk/by-uuid/77ed2d48-365d-4a61-8ada-509e8b7a744c"; }
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
  networking.hostName = "polysaa";
 | 
			
		||||
@ -54,7 +66,7 @@
 | 
			
		||||
      intel-media-driver
 | 
			
		||||
    ];
 | 
			
		||||
  };
 | 
			
		||||
  boot.kernelParams = ["i915.force_probe=7d45"];
 | 
			
		||||
  boot.kernelParams = [ "i915.force_probe=7d45" ];
 | 
			
		||||
 | 
			
		||||
  system.stateVersion = "24.11";
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -6,12 +6,16 @@
 | 
			
		||||
  lib,
 | 
			
		||||
  pkgs,
 | 
			
		||||
  ...
 | 
			
		||||
}: {
 | 
			
		||||
}:
 | 
			
		||||
{
 | 
			
		||||
  imports = [
 | 
			
		||||
    ./locale.nix
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
  nix.settings.experimental-features = ["nix-command" "flakes"];
 | 
			
		||||
  nix.settings.experimental-features = [
 | 
			
		||||
    "nix-command"
 | 
			
		||||
    "flakes"
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
  # Use the systemd-boot EFI boot loader.
 | 
			
		||||
  boot.loader.systemd-boot.enable = true;
 | 
			
		||||
@ -21,10 +25,11 @@
 | 
			
		||||
  # networking.wireless.enable = true;  # Enables wireless support via wpa_supplicant.
 | 
			
		||||
  networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
 | 
			
		||||
 | 
			
		||||
  networking.networkmanager.ensureProfiles.profiles = with builtins;
 | 
			
		||||
    lib.concatMapAttrs
 | 
			
		||||
    (fname: _: import (./networks + "/${fname}"))
 | 
			
		||||
    (lib.filterAttrs (fname: _: lib.hasSuffix ".nix" fname) (readDir ./networks));
 | 
			
		||||
  networking.networkmanager.ensureProfiles.profiles =
 | 
			
		||||
    with builtins;
 | 
			
		||||
    lib.concatMapAttrs (fname: _: import (./networks + "/${fname}")) (
 | 
			
		||||
      lib.filterAttrs (fname: _: lib.hasSuffix ".nix" fname) (readDir ./networks)
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
  # Set your time zone.
 | 
			
		||||
  time.timeZone = "Europe/Paris";
 | 
			
		||||
@ -36,11 +41,16 @@
 | 
			
		||||
  # Define a user account. Don't forget to set a password with ‘passwd’.
 | 
			
		||||
  users.users.mysaa = {
 | 
			
		||||
    isNormalUser = true;
 | 
			
		||||
    extraGroups = ["wheel"]; # Enable ‘sudo’ for the user.
 | 
			
		||||
    packages = with pkgs; [
 | 
			
		||||
      tree
 | 
			
		||||
    ];
 | 
			
		||||
    extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
 | 
			
		||||
  };
 | 
			
		||||
  home-manager.users.mysaa =
 | 
			
		||||
    { pkgs, ... }:
 | 
			
		||||
    {
 | 
			
		||||
      home.packages = with pkgs; [
 | 
			
		||||
        tree
 | 
			
		||||
      ];
 | 
			
		||||
      home.stateVersion = "24.11";
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
  # List packages installed in system profile. To search, run:
 | 
			
		||||
  # $ nix search wget
 | 
			
		||||
 | 
			
		||||
@ -4,7 +4,8 @@
 | 
			
		||||
  pkgs,
 | 
			
		||||
  modulePath,
 | 
			
		||||
  ...
 | 
			
		||||
}: {
 | 
			
		||||
}:
 | 
			
		||||
{
 | 
			
		||||
  # Select internationalisation properties.
 | 
			
		||||
  i18n.defaultLocale = "en_US.UTF-8";
 | 
			
		||||
  console.keyMap = "fr-bepo";
 | 
			
		||||
@ -12,7 +13,10 @@
 | 
			
		||||
  i18n.inputMethod = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
    type = "fcitx5";
 | 
			
		||||
    fcitx5.addons = with pkgs; [fcitx5-gtk fcitx5-mozc];
 | 
			
		||||
    fcitx5.addons = with pkgs; [
 | 
			
		||||
      fcitx5-gtk
 | 
			
		||||
      fcitx5-mozc
 | 
			
		||||
    ];
 | 
			
		||||
    fcitx5.waylandFrontend = true;
 | 
			
		||||
    fcitx5.plasma6Support = true;
 | 
			
		||||
    fcitx5.settings.inputMethod = {
 | 
			
		||||
@ -35,8 +39,12 @@
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
    fcitx5.settings.globalOptions = {
 | 
			
		||||
      "[Hotkey]" = {"EnumerateWithTriggerKeys" = true;};
 | 
			
		||||
      "[Hotkey/TriggerKeys]" = {"0" = "Control+Shift+K";};
 | 
			
		||||
      "[Hotkey]" = {
 | 
			
		||||
        "EnumerateWithTriggerKeys" = true;
 | 
			
		||||
      };
 | 
			
		||||
      "[Hotkey/TriggerKeys]" = {
 | 
			
		||||
        "0" = "Control+Shift+K";
 | 
			
		||||
      };
 | 
			
		||||
      "[Behaviour]" = {
 | 
			
		||||
        "ActiveByDefault" = true;
 | 
			
		||||
      };
 | 
			
		||||
@ -56,7 +64,7 @@
 | 
			
		||||
    enable = true;
 | 
			
		||||
    keyboards = {
 | 
			
		||||
      default = {
 | 
			
		||||
        ids = ["*"];
 | 
			
		||||
        ids = [ "*" ];
 | 
			
		||||
        settings = {
 | 
			
		||||
          main = {
 | 
			
		||||
            "f23+leftshift+leftmeta" = "layer(control)";
 | 
			
		||||
 | 
			
		||||
@ -24,7 +24,7 @@
 | 
			
		||||
      may-fail = "false";
 | 
			
		||||
      method = "auto";
 | 
			
		||||
    };
 | 
			
		||||
    proxy = {};
 | 
			
		||||
    proxy = { };
 | 
			
		||||
    wifi = {
 | 
			
		||||
      mode = "infrastructure";
 | 
			
		||||
      ssid = "eduroam-IPv6only";
 | 
			
		||||
@ -58,7 +58,7 @@
 | 
			
		||||
      addr-gen-mode = "1";
 | 
			
		||||
      method = "auto";
 | 
			
		||||
    };
 | 
			
		||||
    proxy = {};
 | 
			
		||||
    proxy = { };
 | 
			
		||||
    wifi = {
 | 
			
		||||
      mode = "infrastructure";
 | 
			
		||||
      ssid = "eduroam";
 | 
			
		||||
 | 
			
		||||
@ -14,7 +14,7 @@
 | 
			
		||||
      addr-gen-mode = "default";
 | 
			
		||||
      method = "auto";
 | 
			
		||||
    };
 | 
			
		||||
    proxy = {};
 | 
			
		||||
    proxy = { };
 | 
			
		||||
    wifi = {
 | 
			
		||||
      mode = "infrastructure";
 | 
			
		||||
      ssid = "Livebox-bas";
 | 
			
		||||
 | 
			
		||||
@ -6,7 +6,8 @@
 | 
			
		||||
  lib,
 | 
			
		||||
  pkgs,
 | 
			
		||||
  ...
 | 
			
		||||
}: {
 | 
			
		||||
}:
 | 
			
		||||
{
 | 
			
		||||
  imports = [
 | 
			
		||||
    ../basic
 | 
			
		||||
    ./packages.nix
 | 
			
		||||
@ -17,7 +18,10 @@
 | 
			
		||||
  services.displayManager.sddm.enable = true;
 | 
			
		||||
  services.desktopManager.plasma6.enable = true;
 | 
			
		||||
  nixpkgs.config.allowUnfree = true;
 | 
			
		||||
  services.xserver.videoDrivers = ["displaylink" "modesetting"];
 | 
			
		||||
  services.xserver.videoDrivers = [
 | 
			
		||||
    "displaylink"
 | 
			
		||||
    "modesetting"
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
  # Enable CUPS to print documents.
 | 
			
		||||
  # services.printing.enable = true;
 | 
			
		||||
 | 
			
		||||
@ -3,8 +3,9 @@
 | 
			
		||||
  lib,
 | 
			
		||||
  pkgs,
 | 
			
		||||
  ...
 | 
			
		||||
}: {
 | 
			
		||||
  users.users.mysaa.packages = with pkgs; [
 | 
			
		||||
}:
 | 
			
		||||
{
 | 
			
		||||
  home-manager.users.mysaa.home.packages = with pkgs; [
 | 
			
		||||
    firefox
 | 
			
		||||
    vlc
 | 
			
		||||
    (vscode-with-extensions.override {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user