mirror of
https://github.com/JulienMalka/snowfield.git
synced 2025-03-30 08:40:52 +02:00
Fixed newton initrd-login keys (nearly lost newton 10 times on this one)
This commit is contained in:
parent
91361e1910
commit
9a3e067f25
2 changed files with 29 additions and 57 deletions
|
@ -2,21 +2,20 @@
|
||||||
let
|
let
|
||||||
hostName = "newton";
|
hostName = "newton";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
||||||
#programs.home-manager.enable = true;
|
|
||||||
home-manager.users.julien = {
|
home-manager.users.julien = {
|
||||||
home.username = "julien";
|
home.username = "julien";
|
||||||
home.homeDirectory = "/home/julien";
|
home.homeDirectory = "/home/julien";
|
||||||
home.stateVersion = "21.11";
|
home.stateVersion = "21.11";
|
||||||
imports = [../home-manager-modules/mails/default.nix ../home-manager-modules/neovim/default.nix ../home-manager-modules/git/default.nix ];
|
imports = [ ../home-manager-modules/mails/default.nix ../home-manager-modules/neovim/default.nix ../home-manager-modules/git/default.nix ];
|
||||||
luj.emails = {
|
luj.emails = {
|
||||||
enable = true;
|
enable = true;
|
||||||
backend.enable = true;
|
backend.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
luj.programs.neovim.enable = true;
|
luj.programs.neovim.enable = true;
|
||||||
luj.programs.git.enable = true;
|
luj.programs.git.enable = true;
|
||||||
|
|
||||||
};
|
};
|
||||||
boot.loader.grub.enable = true;
|
boot.loader.grub.enable = true;
|
||||||
|
@ -44,27 +43,20 @@ in
|
||||||
|
|
||||||
services.zfs.autoSnapshot.enable = true;
|
services.zfs.autoSnapshot.enable = true;
|
||||||
services.zfs.autoScrub.enable = true;
|
services.zfs.autoScrub.enable = true;
|
||||||
|
|
||||||
boot.initrd.network = {
|
boot.initrd.network = {
|
||||||
# This will use udhcp to get an ip address.
|
|
||||||
# Make sure you have added the kernel module for your network driver to `boot.initrd.availableKernelModules`,
|
|
||||||
# so your initrd can load it!
|
|
||||||
# Static ip addresses might be configured using the ip argument in kernel command line:
|
|
||||||
# https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt
|
|
||||||
enable = true;
|
enable = true;
|
||||||
ssh = {
|
ssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
port = 2222;
|
port = 2222;
|
||||||
# To prevent ssh clients from freaking out because a different host key is used,
|
|
||||||
# a different port for ssh is useful (assuming the same host has also a regular sshd running)
|
|
||||||
# hostKeys paths must be unquoted strings, otherwise you'll run into issues with boot.initrd.secrets
|
|
||||||
# the keys are copied to initrd from the path specified; multiple keys can be set
|
|
||||||
# you can generate any number of host keys using
|
|
||||||
# `ssh-keygen -t ed25519 -N "" -f /path/to/ssh_host_ed25519_key`
|
|
||||||
hostKeys = [ /boot-1/initrd-ssh-key /boot-2/initrd-ssh-key ];
|
hostKeys = [ /boot-1/initrd-ssh-key /boot-2/initrd-ssh-key ];
|
||||||
# public ssh key used for login
|
authorizedKeys = lib.splitString "\n"
|
||||||
|
(builtins.readFile (pkgs.fetchurl {
|
||||||
|
url = "https://github.com/JulienMalka.keys";
|
||||||
|
sha256 = "sha256:2NLoT1/N6Y1uZQ+KLGeRLBPNkc4z3jrYrN9A4bCJWkU=";
|
||||||
|
}));
|
||||||
|
|
||||||
};
|
};
|
||||||
# this will automatically load the zfs password prompt on login
|
|
||||||
# and kill the other prompt so boot can continue
|
|
||||||
postCommands = ''
|
postCommands = ''
|
||||||
zpool import zroot
|
zpool import zroot
|
||||||
echo "zfs load-key -a; killall zfs" >> /root/.profile
|
echo "zfs load-key -a; killall zfs" >> /root/.profile
|
||||||
|
@ -85,32 +77,8 @@ in
|
||||||
|
|
||||||
|
|
||||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||||
users.users.julien = {
|
|
||||||
isNormalUser = true;
|
|
||||||
extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
|
|
||||||
};
|
|
||||||
|
|
||||||
# List packages installed in system profile. To search, run:
|
|
||||||
# $ nix search wget
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
];
|
|
||||||
|
|
||||||
# Some programs need SUID wrappers, can be configured further or are
|
|
||||||
# started in user sessions.
|
|
||||||
# programs.mtr.enable = true;
|
|
||||||
# programs.gnupg.agent = {
|
|
||||||
# enable = true;
|
|
||||||
# enableSSHSupport = true;
|
|
||||||
# };
|
|
||||||
|
|
||||||
# List services that you want to enable:
|
|
||||||
|
|
||||||
# Enable the OpenSSH daemon.
|
|
||||||
services.openssh.enable = true;
|
|
||||||
|
|
||||||
users.users.root.openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM/5+xJDYw1+qFnse+RfEnk1YbtEkpkVNzapWKPmpFIh julien@macintosh" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM9Uzb7szWlux7HuxLZej9cBR5MhLz/vaAPPfSoozt2k julien@enigma.local" ];
|
|
||||||
services.openssh.authorizedKeysFiles = [ "/home/julien/.ssh/authorized_keys" ];
|
|
||||||
|
|
||||||
|
|
||||||
# Open ports in the firewall.
|
# Open ports in the firewall.
|
||||||
networking.firewall.allowedTCPPorts = [ 22 80 443 ];
|
networking.firewall.allowedTCPPorts = [ 22 80 443 ];
|
||||||
networking.firewall.allowedUDPPorts = [ 22 80 443 ];
|
networking.firewall.allowedUDPPorts = [ 22 80 443 ];
|
||||||
|
@ -128,7 +96,8 @@ in
|
||||||
|
|
||||||
|
|
||||||
imports =
|
imports =
|
||||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
[
|
||||||
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "tg3" "xhci_pci" "ahci" "ehci_pci" "usbhid" "usb_storage" "sd_mod" ];
|
boot.initrd.availableKernelModules = [ "tg3" "xhci_pci" "ahci" "ehci_pci" "usbhid" "usb_storage" "sd_mod" ];
|
||||||
|
@ -137,30 +106,33 @@ in
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
fileSystems."/" =
|
fileSystems."/" =
|
||||||
{ device = "zroot/root";
|
{
|
||||||
|
device = "zroot/root";
|
||||||
fsType = "zfs";
|
fsType = "zfs";
|
||||||
options = [ "nofail" ];
|
options = [ "nofail" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/boot-1" =
|
fileSystems."/boot-1" =
|
||||||
{ device = "/dev/disk/by-uuid/15AF-22DB";
|
{
|
||||||
|
device = "/dev/disk/by-uuid/15AF-22DB";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
options = [ "nofail" ];
|
options = [ "nofail" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/boot-2" =
|
fileSystems."/boot-2" =
|
||||||
{ device = "/dev/disk/by-uuid/15EC-BC00";
|
{
|
||||||
|
device = "/dev/disk/by-uuid/15EC-BC00";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
options = [ "nofail" ];
|
options = [ "nofail" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
swapDevices = [ ];
|
swapDevices = [ ];
|
||||||
|
|
||||||
|
|
||||||
luj = {
|
luj = {
|
||||||
filerun.enable = true;
|
filerun.enable = true;
|
||||||
zfs-mails.enable = true;
|
zfs-mails.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
openssh.authorizedKeys.keyFiles = [
|
openssh.authorizedKeys.keyFiles = [
|
||||||
(pkgs.fetchurl {
|
(pkgs.fetchurl {
|
||||||
url = "https://github.com/JulienMalka.keys";
|
url = "https://github.com/JulienMalka.keys";
|
||||||
sha256 = "sha256:d9IujbXim6tE3RYdwPwqRVMOEmRW/gbDkHlYn/QnG0w=";
|
sha256 = "sha256:2NLoT1/N6Y1uZQ+KLGeRLBPNkc4z3jrYrN9A4bCJWkU=";
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue