diff --git a/modules/features/nixos-base.nix b/modules/features/nixos-base.nix new file mode 100644 index 0000000..c0ae6d0 --- /dev/null +++ b/modules/features/nixos-base.nix @@ -0,0 +1,42 @@ +{ self, inputs, ... }: { + flake.modules.nixos.base = { + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + nixpkgs.config = { + permittedInsecurePackages = [ "openssl-1.1.1w" ]; + allowUnfree = true; + }; + + # Set your time zone. + time.timeZone = "US/Central"; + + # Select internationalisation properties. + i18n = { + defaultLocale = "en_US.UTF-8"; + extraLocaleSettings = { + LC_ADDRESS = "en_US.UTF-8"; + LC_IDENTIFICATION = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_NAME = "en_US.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_TELEPHONE = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; + }; + + fonts.packages = with pkgs; [ + nerd-fonts.hack + nerd-fonts.sauce-code-pro + ]; + + # Need for less pain-in-the-ass for doing normal-ish stuff + # This is needed for VSCode remote support. Read: https://nixos.wiki/wiki/Visual_Studio_Code + programs.nix-ld.enable = true; + + # Configure network connections interactively with nmcli or nmtui. + networking.networkmanager.enable = true; + + services.openssh.enable = true; + } +} \ No newline at end of file diff --git a/modules/hosts/john-p14s/configuration.nix b/modules/hosts/john-p14s/configuration.nix index c9bb2ed..d48f51e 100644 --- a/modules/hosts/john-p14s/configuration.nix +++ b/modules/hosts/john-p14s/configuration.nix @@ -9,28 +9,15 @@ in { imports = [ + self.modules.nixos.base self.modules.nixos.p14sHardware ]; - nix.settings.experimental-features = [ "nix-command" "flakes" ]; - nixpkgs.config = { - permittedInsecurePackages = [ "openssl-1.1.1w" ]; - allowUnfree = true; - }; - rebuild.flakeDir = flakeDir; - networking = { - hostName = hostname; - networkmanager.enable = true; - }; - - # Enable automatic login for the user. - # services.displayManager.autoLogin.enable = true; - # services.displayManager.autoLogin.user = "john"; + networking.hostname = hostname; programs.zsh.enable = true; - services.openssh.enable = true; services.tailscale.enable = true; # List packages installed in system profile. To search, run: @@ -54,9 +41,6 @@ # TODO this should not be a hardcoded username }; - # This is needed for VSCode remote support. Read: https://nixos.wiki/wiki/Visual_Studio_Code - programs.nix-ld.enable = true; - # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It's perfectly fine and recommended to leave @@ -65,30 +49,6 @@ # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). system.stateVersion = "24.05"; # Did you read the comment? - # Set your time zone. - time.timeZone = "America/Chicago"; - - # Select internationalisation properties. - i18n = { - defaultLocale = "en_US.UTF-8"; - extraLocaleSettings = { - LC_ADDRESS = "en_US.UTF-8"; - LC_IDENTIFICATION = "en_US.UTF-8"; - LC_MEASUREMENT = "en_US.UTF-8"; - LC_MONETARY = "en_US.UTF-8"; - LC_NAME = "en_US.UTF-8"; - LC_NUMERIC = "en_US.UTF-8"; - LC_PAPER = "en_US.UTF-8"; - LC_TELEPHONE = "en_US.UTF-8"; - LC_TIME = "en_US.UTF-8"; - }; - }; - - fonts.packages = with pkgs; [ - nerd-fonts.hack - nerd-fonts.sauce-code-pro - ]; - services.libinput.enable = true; # Enable touchpad support (enabled default in most desktopManager). services.fprintd.enable = true; # Enables fingerprint sensor diff --git a/modules/hosts/omen-nixos/configuration.nix b/modules/hosts/omen-nixos/configuration.nix index a145d6f..9c8e5b8 100644 --- a/modules/hosts/omen-nixos/configuration.nix +++ b/modules/hosts/omen-nixos/configuration.nix @@ -4,6 +4,7 @@ # import any other modules from here imports = [ self.modules.nixos.omenHardware + self.modules.nixos.base self.modules.nixos.greetd self.modules.nixos.niri ]; @@ -17,14 +18,6 @@ networking.hostName = "nixos-omen"; # Define your hostname. - nix.settings.experimental-features = [ "nix-command" "flakes" ]; - - # Configure network connections interactively with nmcli or nmtui. - networking.networkmanager.enable = true; - - # Set your time zone. - time.timeZone = "US/Central"; - # Configure network proxy if necessary # networking.proxy.default = "http://user:password@proxy:port/"; # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; @@ -37,16 +30,6 @@ # useXkbConfig = true; # use xkb.options in tty. # }; - # Enable the X11 windowing system. - # services.xserver.enable = true; - - - - - # Configure keymap in X11 - # services.xserver.xkb.layout = "us"; - # services.xserver.xkb.options = "eurosign:e,caps:escape"; - # Enable CUPS to print documents. # services.printing.enable = true;