From 8cab39af190d61a5af58aae4a931ea45e576550d Mon Sep 17 00:00:00 2001 From: Hello-User Date: Sat, 1 Jul 2023 00:38:56 +0200 Subject: [PATCH] Initial seperation of files --- audio.nix | 20 +++++++++ bootloader.nix | 10 +++++ configuration.nix | 105 +++----------------------------------------- hibernation.nix | 6 +++ system-packages.nix | 25 +++++++++++ update-config.sh | 6 ++- user-packages.nix | 45 +++++++++++++++++++ users.nix | 10 +++++ 8 files changed, 126 insertions(+), 101 deletions(-) create mode 100644 audio.nix create mode 100644 bootloader.nix create mode 100644 hibernation.nix create mode 100644 system-packages.nix create mode 100644 user-packages.nix create mode 100644 users.nix diff --git a/audio.nix b/audio.nix new file mode 100644 index 0000000..8040d3f --- /dev/null +++ b/audio.nix @@ -0,0 +1,20 @@ +{ config, lib, pkgs, ... }: + +{ + # Enable sound with pipewire. + sound.enable = true; + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + # If you want to use JACK applications, uncomment this + #jack.enable = true; + + # use the example session manager (no others are packaged yet so this is enabled by default, + # no need to redefine it in your config for now) + #media-session.enable = true; + }; +} \ No newline at end of file diff --git a/bootloader.nix b/bootloader.nix new file mode 100644 index 0000000..f318a32 --- /dev/null +++ b/bootloader.nix @@ -0,0 +1,10 @@ +{ config, pkgs, ... }: + +{ + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + boot.loader.systemd-boot.configurationLimit=2; + boot.initrd.systemd.enable = true; + boot.plymouth.enable = true; +} \ No newline at end of file diff --git a/configuration.nix b/configuration.nix index 1c02c42..e916979 100644 --- a/configuration.nix +++ b/configuration.nix @@ -10,15 +10,14 @@ ./hardware-configuration.nix + ./user-packages.nix + ./users.nix + ./audio.nix + ./system-packages.nix + ./hibernation.nix + ./bootloader.nix ]; - # Bootloader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - boot.loader.systemd-boot.configurationLimit=2; - boot.initrd.systemd.enable = true; - boot.plymouth.enable = true; - # Setup keyfile boot.initrd.secrets = { "/crypto_keyfile.bin" = null; @@ -68,98 +67,9 @@ # Enable CUPS to print documents. services.printing.enable = true; - # Enable sound with pipewire. - sound.enable = true; - hardware.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - # If you want to use JACK applications, uncomment this - #jack.enable = true; - - # use the example session manager (no others are packaged yet so this is enabled by default, - # no need to redefine it in your config for now) - #media-session.enable = true; - }; - # Enable touchpad support (enabled default in most desktopManager). # services.xserver.libinput.enable = true; - # Define a user account. Don't forget to set a password with ‘passwd’. - users.users.shaquille = { - isNormalUser = true; - description = "Shaquille Soekhlal"; - extraGroups = [ "networkmanager" "wheel" ]; - packages = with pkgs; [ - firefox - neovim - gparted - microsoft-edge - bitwarden - telegram-desktop - vscode.fhs - dotnet-sdk_7 - parsec-bin - anydesk - remmina - gnomeExtensions.remmina-search-provider - spotify - vimPlugins.nvchad - vimPlugins.nvchad-ui - vimPlugins.nvchad-extensions - barrier - protonup-qt - arduino - gimp-with-plugins - google-chrome - google-chrome-dev - discord - docker - heroic - jellyfin-media-player - nomacs - obs-studio - obsidian - prismlauncher - teamspeak5_client - vmware-workstation - vmware-horizon-client - yubikey-manager-qt - yubikey-touch-detector - #ciscoPacketTracer8 - ]; - }; - - programs.steam.enable = true; - #programs.telegram-desktop.enable = true; - - # Allow unfree packages - nixpkgs.config.allowUnfree = true; - - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; [ - # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. - wget - curl - gnumake - gnat13 - cmake - git - nerdfonts - ripgrep - unzip - nodejs_20 - flatpak - nix-index - roboto - gnomeExtensions.appindicator - dpkg - ]; - fonts.fontDir.enable = true; fonts.fonts = with pkgs; [ roboto @@ -201,7 +111,4 @@ # HibernateDelaySec=5min # ''; - services.logind.lidSwitch = "suspend-then-hibernate"; - environment.etc."systemd/sleep.conf".text = "HibernateDelaySec=30min"; - } diff --git a/hibernation.nix b/hibernation.nix new file mode 100644 index 0000000..835b21f --- /dev/null +++ b/hibernation.nix @@ -0,0 +1,6 @@ +{ config, lib, pkgs, ... }: + +{ + services.logind.lidSwitch = "suspend-then-hibernate"; + environment.etc."systemd/sleep.conf".text = "HibernateDelaySec=30min"; +} \ No newline at end of file diff --git a/system-packages.nix b/system-packages.nix new file mode 100644 index 0000000..8bc8435 --- /dev/null +++ b/system-packages.nix @@ -0,0 +1,25 @@ +{ config, lib, pkgs, ... }: +{ + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + neovim + wget + curl + gnumake + gnat13 + cmake + git + nerdfonts + ripgrep + unzip + nodejs_20 + flatpak + nix-index + roboto + gnomeExtensions.appindicator + dpkg + ]; +} \ No newline at end of file diff --git a/update-config.sh b/update-config.sh index e3b2691..68db196 100755 --- a/update-config.sh +++ b/update-config.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash -sudo rm /etc/nixos/*.nix +rm /etc/nixos/*.nix -sudo cp *.nix /etc/nixos/ +cp *.nix /etc/nixos/ + +nixos-rebuild switch diff --git a/user-packages.nix b/user-packages.nix new file mode 100644 index 0000000..609d858 --- /dev/null +++ b/user-packages.nix @@ -0,0 +1,45 @@ +{ config, lib, pkgs, ... }: + +{ + programs.steam.enable = true; + users.users.shaquille = { + packages = with pkgs; [ + firefox + neovim + gparted + microsoft-edge + bitwarden + telegram-desktop + vscode.fhs + dotnet-sdk_7 + parsec-bin + anydesk + remmina + gnomeExtensions.remmina-search-provider + spotify + vimPlugins.nvchad + vimPlugins.nvchad-ui + vimPlugins.nvchad-extensions + barrier + protonup-qt + arduino + gimp-with-plugins + google-chrome + google-chrome-dev + discord + docker + heroic + jellyfin-media-player + nomacs + obs-studio + obsidian + prismlauncher + teamspeak5_client + vmware-workstation + vmware-horizon-client + yubikey-manager-qt + yubikey-touch-detector + #ciscoPacketTracer8 + ]; + }; +} \ No newline at end of file diff --git a/users.nix b/users.nix new file mode 100644 index 0000000..d0ee90b --- /dev/null +++ b/users.nix @@ -0,0 +1,10 @@ +{ config, lib, pkgs, ... }: + +{ + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.shaquille = { + isNormalUser = true; + description = "Shaquille Soekhlal"; + extraGroups = [ "networkmanager" "wheel" ]; + }; + } \ No newline at end of file