Allow choosing between iwd and wpa_supplicant
This commit is contained in:
parent
0a2f22b0af
commit
c0a5d1f8cc
19 changed files with 384 additions and 199 deletions
hosts/nixos/common
global
optional
users
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
12
hosts/nixos/common/optional/services/iwd.nix
Normal file
12
hosts/nixos/common/optional/services/iwd.nix
Normal 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" ];
|
||||
}
|
4
hosts/nixos/common/optional/users/common.nix
Normal file
4
hosts/nixos/common/optional/users/common.nix
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
authorizedKeys = { outputs, lib }:
|
||||
|
||||
}
|
23
hosts/nixos/common/optional/users/guest.nix
Normal file
23
hosts/nixos/common/optional/users/guest.nix
Normal 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; };
|
||||
};
|
||||
}
|
|
@ -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)
|
||||
];
|
||||
# }}}
|
||||
};
|
||||
# }}}
|
||||
};
|
|
@ -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)
|
||||
];
|
||||
}
|
|
@ -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; };
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue