convert to proper module layout

This commit is contained in:
Noah Masur
2022-12-21 14:18:03 -07:00
parent bf1d2f1e9e
commit d040077d3a
95 changed files with 1196 additions and 895 deletions

View File

@ -1,9 +1,13 @@
{ config, ... }: {
{ config, pkgs, lib, ... }: {
imports = [ ./user.nix ./timezone.nix ./doas.nix ];
# Pin a state version to prevent warnings
system.stateVersion =
config.home-manager.users.${config.user}.home.stateVersion;
config = lib.mkIf pkgs.stdenv.isLinux {
# Pin a state version to prevent warnings
system.stateVersion =
config.home-manager.users.${config.user}.home.stateVersion;
};
}

View File

@ -1,30 +1,35 @@
# Replace sudo with doas
{ config, ... }: {
{ config, pkgs, lib, ... }: {
security = {
config = lib.mkIf pkgs.stdenv.isLinux {
# Remove sudo
sudo.enable = false;
security = {
# Add doas
doas = {
enable = true;
# Remove sudo
sudo.enable = false;
# No password required
wheelNeedsPassword = false;
# Add doas
doas = {
enable = true;
# Pass environment variables from user to root
# Also requires removing password here
extraRules = [{
groups = [ "wheel" ];
noPass = true;
keepEnv = true;
}];
# No password required
wheelNeedsPassword = false;
# Pass environment variables from user to root
# Also requires removing password here
extraRules = [{
groups = [ "wheel" ];
noPass = true;
keepEnv = true;
}];
};
};
home-manager.users.${config.user}.programs.fish.shellAliases = {
sudo = "doas";
};
};
home-manager.users.${config.user}.programs.fish.shellAliases = {
sudo = "doas";
};
}

View File

@ -1,15 +1,19 @@
{ ... }: {
{ config, pkgs, lib, ... }: {
# Service to determine location for time zone
services.geoclue2.enable = true;
services.geoclue2.enableWifi = false; # Breaks when it can't connect
location = { provider = "geoclue2"; };
config = lib.mkIf pkgs.stdenv.isLinux {
# Enable local time based on time zone
services.localtimed.enable = true;
# Service to determine location for time zone
services.geoclue2.enable = true;
services.geoclue2.enableWifi = false; # Breaks when it can't connect
location = { provider = "geoclue2"; };
# Required to get localtimed to talk to geoclue2
services.geoclue2.appConfig.localtimed.isSystem = true;
services.geoclue2.appConfig.localtimed.isAllowed = true;
# Enable local time based on time zone
services.localtimed.enable = true;
# Required to get localtimed to talk to geoclue2
services.geoclue2.appConfig.localtimed.isSystem = true;
services.geoclue2.appConfig.localtimed.isAllowed = true;
};
}

View File

@ -1,4 +1,4 @@
{ config, lib, ... }: {
{ config, pkgs, lib, ... }: {
options = {
@ -11,7 +11,7 @@
};
config = {
config = lib.mkIf (pkgs.stdenv.isLinux) {
# Allows us to declaritively set password
users.mutableUsers = false;