1
Fork 0

Allow choosing between iwd and wpa_supplicant

This commit is contained in:
prescientmoon 2024-08-31 18:38:31 +02:00
parent 0a2f22b0af
commit c0a5d1f8cc
Signed by: prescientmoon
SSH key fingerprint: SHA256:WFp/cO76nbarETAoQcQXuV+0h7XJsEsOCI0UsyPIy6U
19 changed files with 384 additions and 199 deletions

View file

@ -22,7 +22,6 @@ let
./unicode.nix
./persistence.nix
./ports.nix
./wireless
../../../../common
# }}}
@ -48,11 +47,6 @@ in
# Boot using systemd
boot.initrd.systemd.enable = true;
# }}}
# {{{ Disable sudo default lecture
security.sudo.extraConfig = ''
Defaults lecture = never
'';
# }}}
nixpkgs = {
# Add all overlays defined in the overlays directory

View file

@ -22,6 +22,11 @@
# See [the imperanence readme](https://github.com/nix-community/impermanence#home-manager)
programs.fuse.userAllowOther = true;
# {{{ Disable sudo default lecture
security.sudo.extraConfig = ''
Defaults lecture = never
'';
# }}}
# {{{ Create home directories
systemd.tmpfiles.rules =
let

View file

@ -0,0 +1,12 @@
{
networking.wireless.iwd = {
enable = true;
settings = {
IPv6.Enabled = true;
Settings.AutoConnect = true;
};
};
environment.persistence."/persist/state".directories = [ "/var/lib/iwd" ];
}

View file

@ -0,0 +1,4 @@
{
authorizedKeys = { outputs, lib }:
}

View file

@ -0,0 +1,23 @@
# For more comments check out [pilot](./pilot.nix)
{
pkgs,
outputs,
lib,
...
}:
{
users.mutableUsers = false;
users.users.guest = {
isNormalUser = true;
shell = pkgs.fish;
extraGroups = [
"wheel"
"audio"
"video"
"network"
"tty"
];
password = "heyo";
openssh.authorizedKeys.keyFiles = (import ./common.nix).authorizedKeys { inherit outputs lib; };
};
}

View file

@ -47,7 +47,26 @@
hashedPasswordFile = config.sops.secrets.pilot_password.path;
shell = pkgs.fish;
openssh.authorizedKeys.keyFiles = (import ./common.nix).authorizedKeys { inherit outputs lib; };
# {{{ Authorize ssh keys
openssh.authorizedKeys.keyFiles =
let
# Record containing all the hosts
hosts = outputs.nixosConfigurations;
# Function from hostname to relative path to public ssh key
idKey = host: ../../${host}/keys/id_ed25519.pub;
in
lib.pipe hosts [
# attrsetof host -> attrsetof path
(builtins.mapAttrs (name: _: idKey name)) # string -> host -> path
# attrsetof path -> path[]
builtins.attrValues
# path[] -> path[]
(builtins.filter builtins.pathExists)
];
# }}}
};
# }}}
};

View file

@ -1,21 +0,0 @@
{
authorizedKeys = { outputs, lib }:
let
# Record containing all the hosts
hosts = outputs.nixosConfigurations;
# Function from hostname to relative path to public ssh key
idKey = host: ../../${host}/keys/id_ed25519.pub;
in
lib.pipe hosts [
# attrsetof host -> attrsetof path
(builtins.mapAttrs
(name: _: idKey name)) # string -> host -> path
# attrsetof path -> path[]
builtins.attrValues
# path[] -> path[]
(builtins.filter builtins.pathExists)
];
}

View file

@ -1,13 +0,0 @@
# For more comments check out [pilot](./pilot.nix)
{ pkgs, outputs, lib, ... }:
{
users.mutableUsers = false;
users.users.guest = {
isNormalUser = true;
shell = pkgs.fish;
extraGroups = [ "wheel" "audio" "video" "network" "tty" ];
password = "heyo";
openssh.authorizedKeys.keyFiles =
(import ./common.nix).authorizedKeys { inherit outputs lib; };
};
}