From 4b58cbe6879db5ef0d82ac0c810a027e82bb5d4e Mon Sep 17 00:00:00 2001 From: Aria Nolan Date: Thu, 21 Dec 2023 00:50:27 -0500 Subject: [PATCH] added a common module for nixos configurations and set up BICEP --- flake.nix | 11 ++- hosts/BICEP/configuration.nix | 14 ++++ hosts/JWST/configuration.nix | 154 +++------------------------------- modules/nixos-common.nix | 148 ++++++++++++++++++++++++++++++++ 4 files changed, 177 insertions(+), 150 deletions(-) create mode 100644 hosts/BICEP/configuration.nix create mode 100644 modules/nixos-common.nix diff --git a/flake.nix b/flake.nix index 7f4775e..ce555ff 100644 --- a/flake.nix +++ b/flake.nix @@ -56,14 +56,12 @@ # desktop nixosConfigurations."BICEP" = nixpkgs.lib.nixosSystem { inherit system; + specialArgs = {inherit inputs;}; modules = [ ./hosts/BICEP/configuration.nix - home-manager.nixosModules.home-manager - { - home-manager.useGlobalPkgs = true; - home-manager.users."tacocat" = ./users/tacocat/home.nix; - } - ]; + ./modules/nixos-common.nix + {nixpkgs.overlays = overlays;} + ] ++ home-manager-config ./users/tacocat/home.nix; }; # laptop @@ -73,6 +71,7 @@ modules = [ ./hosts/JWST/configuration.nix + ./modules/nixos-common.nix nixos-hardware.nixosModules.dell-xps-15-9520 {nixpkgs.overlays = overlays;} ] diff --git a/hosts/BICEP/configuration.nix b/hosts/BICEP/configuration.nix new file mode 100644 index 0000000..91625c3 --- /dev/null +++ b/hosts/BICEP/configuration.nix @@ -0,0 +1,14 @@ +{ + ... +}: { + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + # ------------ System ------------ + + time.timeZone = "America/New_York"; + + networking.hostName = "BICEP"; +} diff --git a/hosts/JWST/configuration.nix b/hosts/JWST/configuration.nix index 2e5c07b..eb76ec6 100644 --- a/hosts/JWST/configuration.nix +++ b/hosts/JWST/configuration.nix @@ -1,6 +1,5 @@ { # config, - lib, pkgs, ... }: { @@ -11,63 +10,16 @@ # ------------ System ------------ - users.users.tacocat = { - isNormalUser = true; - extraGroups = ["wheel" "networkmanager" "audio" "video" "bluetooth" "kvm"]; - home = "/home/tacocat"; - description = "Aria Nolan"; - }; - - boot.loader = { - efi.canTouchEfiVariables = false; - grub = { - efiSupport = true; - configurationLimit = 10; - device = "nodev"; - extraEntries = '' - menuentry "Void" { - search --set=void --fs-uuid 987518fa-8ea0-49a6-b1e5-1fed4e4ae50f - configfile "($void)/boot/grub/grub.cfg" - } - ''; - }; - }; - - i18n.defaultLocale = "en_US.UTF-8"; - console = { - font = "Lat2-Terminus16"; - keyMap = "us"; - }; + boot.loader.grub.extraEntries = '' + menuentry "Void" { + search --set=void --fs-uuid 987518fa-8ea0-49a6-b1e5-1fed4e4ae50f + configfile "($void)/boot/grub/grub.cfg" + } + ''; time.timeZone = "America/New_York"; networking.hostName = "JWST"; - networking.networkmanager.enable = true; - networking.resolvconf.extraConfig = '' - name_servers="1.1.1.1 1.0.0.1 2606:4700:4700::1111 2606:4700:4700::1001" - name_server_blacklist="129.21.3.17 129.21.4.18 2620:8d:8000:0:aba:ca:daba:ec" - ''; - - # Sound - sound.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - pulse.enable = true; - jack.enable = true; - }; - - # Services/Hardware - hardware.opentabletdriver.enable = true; - hardware.bluetooth.enable = true; - services.blueman.enable = true; - services.printing.enable = true; - services.geoclue2.enable = true; - services.mullvad-vpn.enable = true; - services.mullvad-vpn.enableExcludeWrapper = false; - services.fwupd.enable = true; - security.rtkit.enable = true; - services.resolved.enable = true; # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions @@ -77,98 +29,12 @@ # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). system.stateVersion = "23.05"; # Did you read the comment? - # ------------ Nix ------------ - - nix.settings = { - experimental-features = ["nix-command" "flakes"]; - auto-optimise-store = true; - trusted-users = ["root" "tacocat"]; - }; - - nix.gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 1w"; - }; - - nixpkgs.config.allowUnfreePredicate = pkg: - builtins.elem (lib.getName pkg) [ - "steam" - "steam-original" - "steam-run" - "nvidia-x11" - "nvidia-settings" - "discord" - "spotify" - ]; - - programs.nix-index.enable = true; - programs.command-not-found.enable = false; - - # ------------ Software ------------ - - environment = { - systemPackages = with pkgs; [ - screen - pyocd - vim - exfat - encfs - ntfs3g - ]; - # remove nano - defaultPackages = with pkgs; [ - perl - rsync - strace - ]; - }; - - programs.sway = { - enable = true; - wrapperFeatures.gtk = true; - extraPackages = with pkgs; [ - swaylock - swayidle - brightnessctl - wl-mirror - ]; - }; - - programs.waybar.enable = true; - programs.steam.enable = true; - programs.steam.remotePlay.openFirewall = true; - # programs.steam.gamescopeSession = { - # enable = true; - # args = [ - # "-f" - # "--expose-wayland" - # ]; - # }; - programs.gamemode.enable = true; - # programs.gamescope.enable = true; - - xdg.portal = { - enable = true; - wlr.enable = true; - extraPortals = with pkgs; [ - xdg-desktop-portal-gtk - ]; - }; - - gtk.iconCache.enable = true; - # ------------ Graphics ------------ - hardware.opengl = { - enable = true; - driSupport = true; - driSupport32Bit = true; - extraPackages = with pkgs; [ - intel-compute-runtime - vaapiVdpau - ]; - }; + hardware.opengl.extraPackages = with pkgs; [ + intel-compute-runtime + vaapiVdpau + ]; hardware.nvidia = { modesetting.enable = true; diff --git a/modules/nixos-common.nix b/modules/nixos-common.nix new file mode 100644 index 0000000..68b2b30 --- /dev/null +++ b/modules/nixos-common.nix @@ -0,0 +1,148 @@ +{ + lib, + pkgs, + ... +}: { + + # ------------ System ------------ + + users.users.tacocat = { + isNormalUser = true; + extraGroups = ["wheel" "networkmanager" "audio" "video" "bluetooth" "kvm"]; + home = "/home/tacocat"; + description = "Aria Nolan"; + }; + + boot.loader = { + efi.canTouchEfiVariables = false; + grub = { + efiSupport = true; + configurationLimit = 10; + device = "nodev"; + }; + }; + + i18n.defaultLocale = "en_US.UTF-8"; + console = { + font = "Lat2-Terminus16"; + keyMap = "us"; + }; + + networking.networkmanager.enable = true; + networking.resolvconf.extraConfig = '' + name_servers="1.1.1.1 1.0.0.1 2606:4700:4700::1111 2606:4700:4700::1001" + name_server_blacklist="129.21.3.17 129.21.4.18 2620:8d:8000:0:aba:ca:daba:ec" + ''; + + # Sound + sound.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + pulse.enable = true; + jack.enable = true; + }; + + # Services/Hardware + hardware.opentabletdriver.enable = true; + hardware.bluetooth.enable = true; + services.blueman.enable = true; + services.printing.enable = true; + services.geoclue2.enable = true; + services.mullvad-vpn.enable = true; + services.mullvad-vpn.enableExcludeWrapper = false; + services.fwupd.enable = true; + security.rtkit.enable = true; + services.resolved.enable = true; + + # ------------ Nix ------------ + + nix.settings = { + experimental-features = ["nix-command" "flakes"]; + auto-optimise-store = true; + trusted-users = ["root" "tacocat"]; + }; + + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 1w"; + }; + + nixpkgs.config.allowUnfreePredicate = pkg: + builtins.elem (lib.getName pkg) [ + "steam" + "steam-original" + "steam-run" + "nvidia-x11" + "nvidia-settings" + "discord" + "spotify" + ]; + + programs.nix-index.enable = true; + programs.command-not-found.enable = false; + + # ------------ Software ------------ + + environment = { + systemPackages = with pkgs; [ + screen + pyocd + vim + exfat + encfs + ntfs3g + ]; + # remove nano + defaultPackages = with pkgs; [ + perl + rsync + strace + ]; + }; + + programs.sway = { + enable = true; + wrapperFeatures.gtk = true; + extraPackages = with pkgs; [ + swaylock + swayidle + brightnessctl + wl-mirror + ]; + }; + + programs.waybar.enable = true; + programs.steam.enable = true; + programs.steam.remotePlay.openFirewall = true; + # programs.steam.gamescopeSession = { + # enable = true; + # args = [ + # "-f" + # "--expose-wayland" + # ]; + # }; + programs.gamemode.enable = true; + # programs.gamescope.enable = true; + + xdg.portal = { + enable = true; + wlr.enable = true; + extraPortals = with pkgs; [ + xdg-desktop-portal-gtk + ]; + }; + + gtk.iconCache.enable = true; + + # ------------ Graphics ------------ + + hardware.opengl = { + enable = true; + driSupport = true; + driSupport32Bit = true; + }; + +} +