mirror of
https://github.com/nmasur/dotfiles
synced 2025-07-05 16:10:14 +00:00
move all files to new nixfmt rfc
This commit is contained in:
@ -1,4 +1,10 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
# This setting only applies to NixOS, different on Darwin
|
||||
nix.gc.dates = "09:03"; # Run every morning (but before upgrade)
|
||||
@ -19,8 +25,10 @@
|
||||
|
||||
# Create an email notification service for failed jobs
|
||||
systemd.services."notify-email@" =
|
||||
let address = "system@${config.mail.server}";
|
||||
in {
|
||||
let
|
||||
address = "system@${config.mail.server}";
|
||||
in
|
||||
{
|
||||
enable = config.mail.enable;
|
||||
environment.SERVICE_ID = "%i";
|
||||
script = ''
|
||||
@ -40,8 +48,7 @@
|
||||
};
|
||||
|
||||
# Send an email whenever auto upgrade fails
|
||||
systemd.services.nixos-upgrade.onFailure =
|
||||
lib.mkIf config.systemd.services."notify-email@".enable
|
||||
[ "notify-email@%i.service" ];
|
||||
|
||||
systemd.services.nixos-upgrade.onFailure = lib.mkIf config.systemd.services."notify-email@".enable [
|
||||
"notify-email@%i.service"
|
||||
];
|
||||
}
|
||||
|
@ -1,14 +1,22 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
imports =
|
||||
[ ./auto-upgrade.nix ./doas.nix ./journald.nix ./user.nix ./timezone.nix ];
|
||||
imports = [
|
||||
./auto-upgrade.nix
|
||||
./doas.nix
|
||||
./journald.nix
|
||||
./user.nix
|
||||
./timezone.nix
|
||||
];
|
||||
|
||||
config = lib.mkIf pkgs.stdenv.isLinux {
|
||||
|
||||
# Pin a state version to prevent warnings
|
||||
system.stateVersion =
|
||||
config.home-manager.users.${config.user}.home.stateVersion;
|
||||
|
||||
system.stateVersion = config.home-manager.users.${config.user}.home.stateVersion;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,12 @@
|
||||
# Replace sudo with doas
|
||||
|
||||
{ config, pkgs, lib, ... }: {
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
config = lib.mkIf pkgs.stdenv.isLinux {
|
||||
|
||||
@ -18,24 +24,25 @@
|
||||
|
||||
# Pass environment variables from user to root
|
||||
# Also requires specifying that we are removing password here
|
||||
extraRules = [{
|
||||
groups = [ "wheel" ];
|
||||
noPass = true;
|
||||
keepEnv = true;
|
||||
}];
|
||||
extraRules = [
|
||||
{
|
||||
groups = [ "wheel" ];
|
||||
noPass = true;
|
||||
keepEnv = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
home-manager.users.${config.user}.programs = {
|
||||
|
||||
# Alias sudo to doas for convenience
|
||||
fish.shellAliases = { sudo = "doas"; };
|
||||
fish.shellAliases = {
|
||||
sudo = "doas";
|
||||
};
|
||||
|
||||
# Disable overriding our sudo alias with a TERMINFO alias
|
||||
kitty.settings.shell_integration = "no-sudo";
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
{ ... }: {
|
||||
{ ... }:
|
||||
{
|
||||
|
||||
# How long to keep journalctl entries
|
||||
# This helps to make sure log disk usage doesn't grow too unwieldy
|
||||
@ -7,5 +8,4 @@
|
||||
MaxFileSec=1month
|
||||
MaxRetentionSec=2month
|
||||
'';
|
||||
|
||||
}
|
||||
|
@ -1,11 +1,19 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
config = lib.mkIf pkgs.stdenv.isLinux {
|
||||
|
||||
# Service to determine location for time zone
|
||||
services.geoclue2.enable = true;
|
||||
services.geoclue2.enableWifi = false; # Breaks when it can't connect
|
||||
location = { provider = "geoclue2"; };
|
||||
location = {
|
||||
provider = "geoclue2";
|
||||
};
|
||||
|
||||
# Enable local time based on time zone
|
||||
services.localtimed.enable = true;
|
||||
@ -17,7 +25,5 @@
|
||||
# Fix "Failed to set timezone"
|
||||
# https://github.com/NixOS/nixpkgs/issues/68489#issuecomment-1484030107
|
||||
services.geoclue2.enableDemoAgent = lib.mkForce true;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,10 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options = {
|
||||
|
||||
@ -8,7 +14,6 @@
|
||||
default = null;
|
||||
# Test it by running: mkpasswd -m sha-512 --salt "PZYiMGmJIIHAepTM"
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
config = {
|
||||
@ -28,7 +33,6 @@
|
||||
extraGroups = [
|
||||
"wheel" # Sudo privileges
|
||||
];
|
||||
|
||||
};
|
||||
|
||||
# Allow writing custom scripts outside of Nix
|
||||
@ -59,10 +63,10 @@
|
||||
desktop = "$HOME/other/desktop";
|
||||
publicShare = "$HOME/other/public";
|
||||
templates = "$HOME/other/templates";
|
||||
extraConfig = { XDG_DEV_DIR = "$HOME/dev"; };
|
||||
extraConfig = {
|
||||
XDG_DEV_DIR = "$HOME/dev";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user