diff --git a/extra_info.nix b/extra_info.nix index 579050c..e0d1188 100644 --- a/extra_info.nix +++ b/extra_info.nix @@ -1,16 +1,15 @@ -{ - config, - lib, - pkgs, - ... -}: +{lib, ...}: with lib; with builtins; { options = { extraInfo.email = mkOption { - type = types.nullOr types.str; + type = types.str; description = "Email address"; - default = null; + }; + + extraInfo.username = mkOption { + type = types.str; + description = "Username to deploy the configuration as"; }; extraInfo.inputs = { diff --git a/flake.nix b/flake.nix index 51b6278..fdd0c9c 100644 --- a/flake.nix +++ b/flake.nix @@ -77,6 +77,8 @@ neovimTraxys = inputs.nvim-traxys.packages."${system}".nvim; roaming_proxy = inputs.roaming_proxy.defaultPackage."${system}"; }; + + extraInfo = import ./extra_info.nix; in { templates = { rust = { @@ -87,18 +89,26 @@ packages.x86_64-linux = pkgList "x86_64-linux" nixpkgs.legacyPackages.x86_64-linux.callPackage; hmModules = { - minimal = import ./minimal { + minimal = import ./minimal/hm.nix { inherit inputs; flake = self; }; }; + nixosModules = { + minimal = import ./minimal/nixos.nix { + inherit extraInfo; + }; + }; + overlays.x86_64-linux = final: prev: pkgList "x86_64-linux" prev.callPackage; nixosConfigurations = { ZeNixLaptop = nixpkgs.lib.nixosSystem rec { system = "x86_64-linux"; modules = [ + ./hostconfig/ZeNixComputa/extra_info.nix + self.nixosModules.minimal ({pkgs, ...}: { nixpkgs.overlays = [ inputs.nur.overlay @@ -121,6 +131,7 @@ ... }: { imports = [ + self.hmModules.minimal ./home.nix ./graphical.nix ./extra_info.nix @@ -128,7 +139,6 @@ ./wm ./rustdev.nix ./git - self.hmModules.minimal ]; }; home-manager.extraSpecialArgs = { diff --git a/hostconfig/ZeNixComputa/extra_info.nix b/hostconfig/ZeNixComputa/extra_info.nix new file mode 100644 index 0000000..0231065 --- /dev/null +++ b/hostconfig/ZeNixComputa/extra_info.nix @@ -0,0 +1,3 @@ +{ + extraInfo.username = "traxys"; +} diff --git a/minimal/default.nix b/minimal/hm.nix similarity index 98% rename from minimal/default.nix rename to minimal/hm.nix index 3ee16f3..8d4f280 100644 --- a/minimal/default.nix +++ b/minimal/hm.nix @@ -145,7 +145,5 @@ home.file = { ".zprofile".source = ./zprofile; }; - - home.stateVersion = "21.11"; }; } diff --git a/minimal/nixos.nix b/minimal/nixos.nix new file mode 100644 index 0000000..a6e8e1b --- /dev/null +++ b/minimal/nixos.nix @@ -0,0 +1,56 @@ +{extraInfo}: { + config, + pkgs, + ... +}: { + imports = [extraInfo]; + + users.users."${config.extraInfo.username}" = { + isNormalUser = true; + home = "/home/${config.extraInfo.username}"; + shell = pkgs.zsh; + }; + + programs.zsh.enable = true; + + i18n.defaultLocale = "en_GB.UTF-8"; + console = { + font = "Lat2-Terminus16"; + keyMap = "dvorak-programmer"; + }; + + environment.pathsToLink = ["/share/zsh"]; + fonts.enableDefaultFonts = true; + fonts = { + fonts = with pkgs; [ + (nerdfonts.override {fonts = ["Hack"];}) + dejavu_fonts + ]; + fontconfig = { + defaultFonts = { + serif = ["DejaVu"]; + sansSerif = ["DejaVu Sans"]; + monospace = ["Hack"]; + }; + }; + }; + + nix = { + package = pkgs.nixUnstable; + + extraOptions = '' + experimental-features = nix-command flakes + ''; + + settings = { + auto-optimise-store = true; + substituters = ["https://nix-gaming.cachix.org"]; + trusted-public-keys = ["nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="]; + }; + }; + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 14d"; + }; +} diff --git a/nixos/configuration.nix b/nixos/configuration.nix index c50b95a..4bcf92f 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -20,14 +20,6 @@ # replicates the default behaviour. networking.useDHCP = false; - # Select internationalisation properties. - i18n.defaultLocale = "en_GB.UTF-8"; - console = { - font = "Lat2-Terminus16"; - keyMap = "dvorak-programmer"; - }; - - environment.pathsToLink = ["/share/zsh"]; security.rtkit.enable = true; services = { tzupdate.enable = true; @@ -51,21 +43,6 @@ programs.nix-ld.enable = true; hardware.opentabletdriver.enable = true; - fonts.enableDefaultFonts = true; - fonts = { - fonts = with pkgs; [ - (nerdfonts.override {fonts = ["Hack"];}) - dejavu_fonts - ]; - fontconfig = { - defaultFonts = { - serif = ["DejaVu"]; - sansSerif = ["DejaVu Sans"]; - monospace = ["Hack"]; - }; - }; - }; - boot.kernelPackages = pkgs.linuxPackages; /* nixpkgs.config.allowBroken = true; @@ -128,13 +105,6 @@ ]; }; - nix.settings.auto-optimise-store = true; - nix.gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 14d"; # Ajuste comme tu veux, tu peux utiliser +5 pour garder les 5 dernières, etc. - }; - # 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 diff --git a/nixos/localcfg.nix b/nixos/localcfg.nix index 4e8a804..4bc0941 100644 --- a/nixos/localcfg.nix +++ b/nixos/localcfg.nix @@ -58,8 +58,6 @@ users = { traxys = { uid = 1000; - isNormalUser = true; - home = "/home/traxys"; extraGroups = [ "wheel" "networkmanager" @@ -72,7 +70,6 @@ "scanner" "lp" ]; - shell = pkgs.zsh; }; }; }; diff --git a/nixos/pkg.nix b/nixos/pkg.nix index 0fd7bd9..95e3dfe 100644 --- a/nixos/pkg.nix +++ b/nixos/pkg.nix @@ -17,13 +17,6 @@ in { }; }; - nix = { - package = pkgs.nixUnstable; - extraOptions = '' - experimental-features = nix-command flakes - ''; - }; - # boot.extraModulePackages = [ ashmem binder ]; # boot.kernelModules = [ "ashmem_linux" "binder_linux" ];