Added user setup

This commit is contained in:
Julien Malka 2021-12-11 13:36:08 +01:00
parent 42cd7bb365
commit 91361e1910
6 changed files with 64 additions and 51 deletions

21
base.nix Normal file
View file

@ -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;
}

View file

@ -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;
}

24
flake.lock generated
View file

@ -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": {

28
modules/nix/default.nix Normal file
View file

@ -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
'';
};
};
}

View file

@ -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=";
})
];
};

View file

@ -12,7 +12,7 @@ in
inherit inputs;
};
modules = builtins.attrValues modules ++ [
./configuration.nix
./base.nix
host-config
home-manager.nixosModules.home-manager
{