diff --git a/base.nix b/base.nix new file mode 100644 index 0000000..c4d7711 --- /dev/null +++ b/base.nix @@ -0,0 +1,21 @@ +{ config, pkgs, ... }: + +{ + + imports = [ ./users/julien.nix ]; + luj.nix.enable = true; + + time.timeZone = "Europe/Paris"; + i18n.defaultLocale = "en_US.UTF-8"; + console = { + font = "Lat2-Terminus16"; + keyMap = "fr"; + }; + + + #boot.kernelPackages = pkgs.linuxPackages_latest; + + services.openssh.enable = true; + + +} diff --git a/configuration.nix b/configuration.nix deleted file mode 100644 index 3dce2a1..0000000 --- a/configuration.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ config, pkgs, ... }: - -{ - nix = { - autoOptimiseStore = true; - allowedUsers = [ "julien" ]; - gc = { - automatic = true; - dates = "daily"; - }; - package = pkgs.nixUnstable; - extraOptions = '' - experimental-features = nix-command flakes - ''; - }; - - - time.timeZone = "Europe/Paris"; - i18n.defaultLocale = "en_US.UTF-8"; - console = { - font = "Lat2-Terminus16"; - keyMap = "fr"; - }; - - users.users.julien = { - isNormalUser = true; - extraGroups = [ "wheel" ]; - home = "/home/julien"; - shell = pkgs.fish; - }; - - #boot.kernelPackages = pkgs.linuxPackages_latest; - - services.openssh.enable = true; - - -} diff --git a/flake.lock b/flake.lock index 0c4e91a..95f2ad3 100644 --- a/flake.lock +++ b/flake.lock @@ -38,11 +38,11 @@ ] }, "locked": { - "lastModified": 1638959036, - "narHash": "sha256-d75Ow/rV3nq4penfTJz9H3/OlIHttoKoJUDEfink/8k=", + "lastModified": 1639223729, + "narHash": "sha256-C+OYsFVCNZwzQ4ShMBTJaFS489auGr42cDrceckKpXc=", "owner": "nix-community", "repo": "home-manager", - "rev": "829e89a16f4f96428d1b94e68d4c06107b5491c0", + "rev": "6fe3b539e057feadbf94e845412f4b438260690b", "type": "github" }, "original": { @@ -74,11 +74,11 @@ }, "locked": { "dir": "contrib", - "lastModified": 1639103355, - "narHash": "sha256-wWnqc8isaB4QX+zHV3WDYw5FbAUKb7rZuvMKDrNFtnI=", + "lastModified": 1639175880, + "narHash": "sha256-G2O/ViPfnLYCA/GriyN1HdIdU5COSCF1SVGSy1TGB+I=", "owner": "neovim", "repo": "neovim", - "rev": "ac2d140a33dfe88f882218e15a443b8300cca6b2", + "rev": "3f8703093de56254ffdbf8ef6ddbe7942af54257", "type": "github" }, "original": { @@ -95,11 +95,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1639124025, - "narHash": "sha256-okHiC/RiJYq9C37JVpiuGE8KPiud3OAzFGSX8+i7E/Q=", + "lastModified": 1639210387, + "narHash": "sha256-5HiroEpFRN5tG88X5ZWM7K+Pr2Q5bYmzJhgKVVbbhYg=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "f85eb1d7a4512c63725dbf03737269f3544dccb2", + "rev": "f38af8005370113e959c111ec8723450bb50f8b8", "type": "github" }, "original": { @@ -158,11 +158,11 @@ }, "nur": { "locked": { - "lastModified": 1639134982, - "narHash": "sha256-iBa3GjvmEKn26FNp1TTwYp8pxwleczC7G6zkXf1A79U=", + "lastModified": 1639213198, + "narHash": "sha256-yo7yibkdqey6jAJZVT8h01H9fnFHc1e/MkP0OnfeHJA=", "owner": "nix-community", "repo": "NUR", - "rev": "65887ad64ee3adef81b6efbc6d4361a40c5aebe0", + "rev": "119cb1d52853c245666eaef9dfb1a11b4b6eb48d", "type": "github" }, "original": { diff --git a/modules/nix/default.nix b/modules/nix/default.nix new file mode 100644 index 0000000..26c08fd --- /dev/null +++ b/modules/nix/default.nix @@ -0,0 +1,28 @@ +{ pkgs, config, lib, ... }: +let + cfg = config.luj.nix; +in +with lib; +{ + options.luj.nix = { + enable = mkEnableOption "Enable nix experimental"; + }; + + config = mkIf cfg.enable + { + nix = { + autoOptimiseStore = true; + allowedUsers = [ "julien" ]; + gc = { + automatic = true; + dates = "daily"; + }; + package = pkgs.nixUnstable; + extraOptions = '' + experimental-features = nix-command flakes + ''; + }; + + + }; +} diff --git a/users/julien.nix b/users/julien.nix index 116f95b..28be81d 100644 --- a/users/julien.nix +++ b/users/julien.nix @@ -3,11 +3,12 @@ users.users.julien = { isNormalUser = true; home = "/home/julien"; + extraGroups = [ "wheel" ]; shell = pkgs.fish; openssh.authorizedKeys.keyFiles = [ (pkgs.fetchurl { url = "https://github.com/JulienMalka.keys"; - sha256 = "sha256:0lhvhdrzp2vphqhkcgl34xzn0sill6w7mgq8xh1akm1z1rsvd9v4"; + sha256 = "sha256:d9IujbXim6tE3RYdwPwqRVMOEmRW/gbDkHlYn/QnG0w="; }) ]; }; diff --git a/utils.nix b/utils.nix index 5610eb1..84d7457 100644 --- a/utils.nix +++ b/utils.nix @@ -12,7 +12,7 @@ in inherit inputs; }; modules = builtins.attrValues modules ++ [ - ./configuration.nix + ./base.nix host-config home-manager.nixosModules.home-manager {