From 2075b119db7317efc8f13baf9d4bdc14c6f76e41 Mon Sep 17 00:00:00 2001 From: shibazaki Date: Tue, 14 Jan 2025 16:41:37 +0100 Subject: [PATCH] added second user woohoo --- flake.nix | 37 ++++++++++++++++++------ nixos/home/imports/hyprland.nix | 2 +- nixos/system/home-manager.nix | 3 +- nixos/system/user-configuration.nix | 6 ++-- users/twelve/configuration.nix | 28 ++++++++++++++++++ users/twelve/hardware-configuration.nix | 38 +++++++++++++++++++++++++ users/twelve/home.nix | 26 +++++++++++++++++ 7 files changed, 127 insertions(+), 13 deletions(-) create mode 100644 users/twelve/configuration.nix create mode 100644 users/twelve/hardware-configuration.nix create mode 100644 users/twelve/home.nix diff --git a/flake.nix b/flake.nix index 14f9c16..e0aa07e 100644 --- a/flake.nix +++ b/flake.nix @@ -29,14 +29,35 @@ allowUnfree = true; }; }; - in { - nixosConfigurations.shibazaki = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = { inherit inputs pkgs; }; - modules = [ - ./users/shibazaki/configuration.nix - inputs.stylix.nixosModules.stylix - ]; + in + { + nixosConfigurations = { + shibazaki = nixpkgs.lib.nixosSystem { + system = system; + specialArgs = { + inherit inputs pkgs; + userSettings = { + username = "shibazaki"; + }; + }; + modules = [ + ./users/shibazaki/configuration.nix + inputs.stylix.nixosModules.stylix + ]; + }; + twelve = nixpkgs.lib.nixosSystem { + system = system; + specialArgs = { + inherit inputs pkgs; + userSettings = { + username = "twelve"; + }; + }; + modules = [ + ./users/twelve/configuration.nix + inputs.stylix.nixosModules.stylix + ]; + }; }; }; } diff --git a/nixos/home/imports/hyprland.nix b/nixos/home/imports/hyprland.nix index f74dcaf..1ce2ff8 100644 --- a/nixos/home/imports/hyprland.nix +++ b/nixos/home/imports/hyprland.nix @@ -182,7 +182,7 @@ ]; bind = [ - "$mod, Q, exec, /home/shibazaki/.nix-profile/bin/dontkillsteam" + "$mod, Q, exec, ~/.nix-profile/bin/dontkillsteam" "$mod, Delete, exit" "$mod, W, togglefloating" "$mod, G, togglegroup" diff --git a/nixos/system/home-manager.nix b/nixos/system/home-manager.nix index d27e0aa..c060848 100644 --- a/nixos/system/home-manager.nix +++ b/nixos/system/home-manager.nix @@ -1,6 +1,7 @@ { inputs, pkgs, + userSettings, ... }: { imports = [ @@ -10,7 +11,7 @@ extraSpecialArgs = { inherit inputs pkgs; }; backupFileExtension = "backup"; users = { - shibazaki = import ./../../users/shibazaki/home.nix; + ${userSettings.username} = import ./../../users/${userSettings.username}/home.nix; }; }; } diff --git a/nixos/system/user-configuration.nix b/nixos/system/user-configuration.nix index eec65b2..6fbd279 100644 --- a/nixos/system/user-configuration.nix +++ b/nixos/system/user-configuration.nix @@ -1,7 +1,7 @@ -{ pkgs, ... }: { - users.users.shibazaki = { +{ pkgs, userSettings, ... }: { + users.users.${userSettings.username} = { isNormalUser = true; - description = "shibazaki"; + description = "${userSettings.username}"; extraGroups = ["wheel" "networkmanager"]; }; } diff --git a/users/twelve/configuration.nix b/users/twelve/configuration.nix new file mode 100644 index 0000000..0428e33 --- /dev/null +++ b/users/twelve/configuration.nix @@ -0,0 +1,28 @@ +{ + inputs, + pkgs, + lib, + ... +}: { + imports = [ + ./hardware-configuration.nix + ./../../nixos/system/home-manager.nix + ./../../nixos/system/user-configuration.nix + ./../../nixos/system/desktop-environment.nix + ./../../nixos/system/audio.nix + ./../../nixos/system/fonts.nix + ./../../nixos/system/input-devices.nix + ./../../nixos/system/networking.nix + ./../../nixos/system/bluetooth.nix + ./../../nixos/system/display-manager.nix + ./../../nixos/system/security-and-privacy.nix + ./../../nixos/system/stylix.nix + ./../../nixos/system/system-settings.nix + ./../../nixos/system/asus.nix + ]; + + # Global configuration + nix.settings.experimental-features = ["nix-command" "flakes"]; + system.stateVersion = "24.11"; # Did you read the comment? +} + diff --git a/users/twelve/hardware-configuration.nix b/users/twelve/hardware-configuration.nix new file mode 100644 index 0000000..d328da3 --- /dev/null +++ b/users/twelve/hardware-configuration.nix @@ -0,0 +1,38 @@ +# 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 = [ "nvme" "xhci_pci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/c281b329-1fa0-487b-a42c-8aafda4a224f"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/D0D6-2A60"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = [ ]; + + # 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..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/users/twelve/home.nix b/users/twelve/home.nix new file mode 100644 index 0000000..100244b --- /dev/null +++ b/users/twelve/home.nix @@ -0,0 +1,26 @@ +{ + pkgs, + lib, + ... +}: { + home.username = "twelve"; + home.homeDirectory = "/home/twelve"; + + imports = [ + ./../../nixos/home/imports/hyprland.nix + ./../../nixos/home/imports/starship.nix + ./../../nixos/home/modules/shell.nix + ./../../nixos/home/modules/git.nix + ./../../nixos/home/modules/editors.nix + ./../../nixos/home/modules/terminal.nix + ./../../nixos/home/modules/media.nix + ./../../nixos/home/modules/development.nix + ./../../nixos/home/modules/games.nix + ./../../nixos/home/modules/utilities.nix + ./../../nixos/home/modules/environment.nix + ./../../nixos/home/modules/session-variables.nix + ]; + + home.stateVersion = "24.11"; # Please read the comment before changing. +} +