From 69235e61fab57901b2b25363ba0cce5b42e92993 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Fri, 27 Jan 2023 21:11:08 -0600 Subject: [PATCH] moving server configs to be more modular --- flake.nix | 2 +- modules/base.nix | 15 ++++++- modules/desktop.nix | 7 --- pkgs/base-packages.nix | 1 + system/dalinar/configuration.nix | 55 +---------------------- system/kohlin/configuration.nix | 76 +------------------------------- 6 files changed, 20 insertions(+), 136 deletions(-) diff --git a/flake.nix b/flake.nix index 76c0da2..ec0b9da 100644 --- a/flake.nix +++ b/flake.nix @@ -3,7 +3,7 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-22.05"; + nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-22.11"; home-manager = { url = "github:nix-community/home-manager/master"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/modules/base.nix b/modules/base.nix index 37c2e71..3ce779b 100644 --- a/modules/base.nix +++ b/modules/base.nix @@ -2,10 +2,23 @@ with lib; { - nixpkgs.config.allowUnfree = true; + + nix = { + extraOptions = "experimental-features = nix-command flakes"; + package = pkgs.nixFlakes; + }; + + nixpkgs.config.allowUnFree = true; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + i18n.defaultLocale = "en_US.UTF-8"; time.timeZone = "America/Chicago"; + networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. + # Set default shell to be dash for speed # Apparently this is bad because a lot of nix relies on bash # environment.binsh = "${pkgs.dash}/bin/dash"; diff --git a/modules/desktop.nix b/modules/desktop.nix index 6b51e55..9bb6edd 100644 --- a/modules/desktop.nix +++ b/modules/desktop.nix @@ -21,15 +21,8 @@ with lib; kernelPackages = pkgs.linuxPackages_zen; kernelParams = [ "mem_sleep_default=deep" "nvme.noacpi=1"]; # initrd.kernelModules = [ "amdgpu" ]; - loader = { - systemd-boot.enable = true; - efi.canTouchEfiVariables = true; - }; }; - networking.networkmanager.enable = true; - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - # The global useDHCP flag is deprecated, therefore explicitly set to false here. # Per-interface useDHCP will be mandatory in the future, so this generated config # replicates the default behaviour. diff --git a/pkgs/base-packages.nix b/pkgs/base-packages.nix index 4e889b1..d1dce9a 100644 --- a/pkgs/base-packages.nix +++ b/pkgs/base-packages.nix @@ -44,3 +44,4 @@ neofetch ]; } + diff --git a/system/dalinar/configuration.nix b/system/dalinar/configuration.nix index 22412b0..71752ee 100644 --- a/system/dalinar/configuration.nix +++ b/system/dalinar/configuration.nix @@ -4,33 +4,11 @@ imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix + ../../modules/base.nix + ../../pkgs/base-packages.nix ]; - nix = { - extraOptions = "experimental-features = nix-command flakes"; - package = pkgs.nixFlakes; - }; - - nixpkgs.config.allowUnFree = true; - - # Use the systemd-boot EFI boot loader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - networking.hostName = "dalinar"; # Define your hostname. - # Pick only one of the below networking options. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. - - # Set your time zone. - time.timeZone = "America/Chicago"; - - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - - # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; # Enable the X11 windowing system. # services.xserver.enable = true; @@ -59,9 +37,6 @@ ]; }; - environment.homeBinInPath = true; - programs.fish.enable = true; - # Enable touchpad support (enabled default in most desktopManager). # services.xserver.libinput.enable = true; @@ -71,32 +46,6 @@ extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. }; - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; [ - vim - wget - yt-dlp - bat - ripgrep - ffmpeg-full - rsync - dutree - tmux - git - samba - exa - jq - fd - bc - sysstat - procs - btop - htop - unzip - blesh - ]; - virtualisation.docker.enable = true; # Some programs need SUID wrappers, can be configured further or are diff --git a/system/kohlin/configuration.nix b/system/kohlin/configuration.nix index 25d09f8..5bd761f 100644 --- a/system/kohlin/configuration.nix +++ b/system/kohlin/configuration.nix @@ -4,51 +4,13 @@ imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix + ../../modules/base.nix + ../../pkgs/base-packages.nix ]; - nix = { - extraOptions = "experimental-features = nix-command flakes"; - package = pkgs.nixFlakes; - }; - - nixpkgs.config.allowUnFree = true; - - # Use the systemd-boot EFI boot loader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.efiSysMountPoint = "/boot/efi"; networking.hostName = "kohlin"; # Define your hostname. - # Pick only one of the below networking options. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. - - # Set your time zone. - time.timeZone = "America/Chicago"; - - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - - # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; - - # Enable the X11 windowing system. - # services.xserver.enable = true; - - # Configure keymap in X11 - # services.xserver.layout = "us"; - # services.xserver.xkbOptions = { - # "eurosign:e"; - # "caps:escape" # map caps to escape. - # }; - - # Enable CUPS to print documents. - # services.printing.enable = true; - - # Enable sound. - # sound.enable = true; - # hardware.pulseaudio.enable = true; hardware.opengl = { enable = true; @@ -59,13 +21,6 @@ libvdpau-va-gl ]; }; - - environment.homeBinInPath = true; - programs.fish.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 = { chris = { @@ -74,33 +29,6 @@ }; }; - - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; [ - vim - wget - yt-dlp - bat - ripgrep - ffmpeg-full - rsync - dutree - tmux - git - samba - exa - jq - fd - bc - sysstat - procs - btop - htop - unzip - #blesh - ]; - virtualisation.docker.enable = true; # Some programs need SUID wrappers, can be configured further or are