mirror of
https://github.com/JulienMalka/snowfield.git
synced 2025-07-03 07:47:20 +02:00
Lot of changes, playing with ssh keys
This commit is contained in:
parent
3aab217530
commit
49299dc3b2
8 changed files with 54 additions and 15 deletions
|
@ -9,3 +9,8 @@ creation_rules:
|
||||||
- *macintosh
|
- *macintosh
|
||||||
- *newton
|
- *newton
|
||||||
- *lisa
|
- *lisa
|
||||||
|
- key_groups:
|
||||||
|
- age:
|
||||||
|
- *macintosh
|
||||||
|
- *newton
|
||||||
|
- *lisa
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
./home-julien.nix
|
./home-julien.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
luj = {
|
luj = {
|
||||||
mediaserver.enable = true;
|
mediaserver.enable = true;
|
||||||
homepage.enable = true;
|
homepage.enable = true;
|
||||||
|
|
|
@ -1,5 +1,24 @@
|
||||||
{ pkgs, lib, config, ... }:
|
{ pkgs, lib, config, ... }:
|
||||||
{
|
{
|
||||||
|
|
||||||
|
sops.secrets.ssh-lisa-pub = {
|
||||||
|
owner = "julien";
|
||||||
|
path = "/home/julien/.ssh/id_ed25519.pub";
|
||||||
|
mode = "0644";
|
||||||
|
format = "binary";
|
||||||
|
sopsFile = ../../secrets/ssh-lisa-pub;
|
||||||
|
};
|
||||||
|
|
||||||
|
sops.secrets.ssh-lisa-priv = {
|
||||||
|
owner = "julien";
|
||||||
|
path = "/home/julien/.ssh/id_ed25519";
|
||||||
|
mode = "0600";
|
||||||
|
format = "binary";
|
||||||
|
sopsFile = ../../secrets/ssh-lisa-priv;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
luj.hmgr.julien = {
|
luj.hmgr.julien = {
|
||||||
luj.programs.neovim.enable = true;
|
luj.programs.neovim.enable = true;
|
||||||
luj.programs.ssh-client.enable = true;
|
luj.programs.ssh-client.enable = true;
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
authorizedKeys = lib.splitString "\n"
|
authorizedKeys = lib.splitString "\n"
|
||||||
(builtins.readFile (pkgs.fetchurl {
|
(builtins.readFile (pkgs.fetchurl {
|
||||||
url = "https://github.com/JulienMalka.keys";
|
url = "https://github.com/JulienMalka.keys";
|
||||||
sha256 = "sha256-jx0/AAAeq5d6h1ytdUUnF/bMcn4h0UIKQCwzi3S5+YQ=";
|
sha256 = "sha256-nBgn7jOqi/nPHhTy3x/oirL+A4X2gbmwy1NXLZhV99M=";
|
||||||
}));
|
}));
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -29,6 +29,22 @@ in
|
||||||
|
|
||||||
sops.secrets.drone = { };
|
sops.secrets.drone = { };
|
||||||
|
|
||||||
|
sops.secrets.ssh-drone-pub = {
|
||||||
|
owner = drone;
|
||||||
|
path = "/home/drone/.ssh/id_ed25519.pub";
|
||||||
|
mode = "0644";
|
||||||
|
format = "binary";
|
||||||
|
sopsFile = ../../secrets/ssh-drone-pub;
|
||||||
|
};
|
||||||
|
|
||||||
|
sops.secrets.ssh-drone-priv = {
|
||||||
|
owner = drone;
|
||||||
|
path = "/home/drone/.ssh/id_ed25519";
|
||||||
|
mode = "0600";
|
||||||
|
format = "binary";
|
||||||
|
sopsFile = ../../secrets/ssh-drone-priv;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
systemd.services.drone-server = {
|
systemd.services.drone-server = {
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
|
|
@ -20,6 +20,7 @@ with lib;
|
||||||
package = pkgs.nixUnstable;
|
package = pkgs.nixUnstable;
|
||||||
extraOptions = ''
|
extraOptions = ''
|
||||||
experimental-features = nix-command flakes
|
experimental-features = nix-command flakes
|
||||||
|
narinfo-cache-negative-ttl = 0
|
||||||
'';
|
'';
|
||||||
nixPath = [
|
nixPath = [
|
||||||
"nixpkgs=${inputs.nixpkgs}"
|
"nixpkgs=${inputs.nixpkgs}"
|
||||||
|
|
|
@ -1,20 +1,19 @@
|
||||||
{ config, pkgs, lib, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
|
|
||||||
users.mutableUsers = false;
|
users.mutableUsers = false;
|
||||||
users.defaultUserShell = pkgs.fish;
|
users.defaultUserShell = pkgs.fish;
|
||||||
sops.secrets.user-root-password.neededForUsers = true;
|
sops.secrets.user-root-password.neededForUsers = true;
|
||||||
|
|
||||||
programs.fish.enable = true;
|
programs.fish.enable = true;
|
||||||
|
|
||||||
users.users.root = {
|
users.users.root = {
|
||||||
uid = config.ids.uids.root;
|
uid = config.ids.uids.root;
|
||||||
description = "System administrator";
|
description = "System administrator";
|
||||||
home = "/root";
|
home = "/root";
|
||||||
shell = lib.mkForce config.users.defaultUserShell;
|
shell = lib.mkForce config.users.defaultUserShell;
|
||||||
group = "root";
|
group = "root";
|
||||||
passwordFile = config.sops.secrets.user-root-password.path;
|
passwordFile = config.sops.secrets.user-root-password.path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,23 +1,21 @@
|
||||||
{ config, pkgs, lib, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
|
|
||||||
sops.secrets.user-julien-password.neededForUsers = true;
|
sops.secrets.user-julien-password.neededForUsers = true;
|
||||||
|
|
||||||
|
|
||||||
users.users.julien = {
|
users.users.julien = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
home = "/home/julien";
|
home = "/home/julien";
|
||||||
extraGroups = [ "wheel" "docker" config.users.groups.keys.name];
|
extraGroups = [ "wheel" config.users.groups.keys.name];
|
||||||
shell = pkgs.fish;
|
shell = pkgs.fish;
|
||||||
passwordFile = config.sops.secrets.user-julien-password.path;
|
passwordFile = config.sops.secrets.user-julien-password.path;
|
||||||
openssh.authorizedKeys.keyFiles = [
|
openssh.authorizedKeys.keyFiles = [
|
||||||
(pkgs.fetchurl {
|
(pkgs.fetchurl {
|
||||||
url = "https://github.com/JulienMalka.keys";
|
url = "https://github.com/JulienMalka.keys";
|
||||||
sha256 = "sha256-jx0/AAAeq5d6h1ytdUUnF/bMcn4h0UIKQCwzi3S5+YQ=";
|
sha256 = "sha256-nBgn7jOqi/nPHhTy3x/oirL+A4X2gbmwy1NXLZhV99M=";
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
nix.allowedUsers = [ "julien" ];
|
nix.allowedUsers = [ "julien" ];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue