modularized into machine
This commit is contained in:
9
modules/common/README.md
Normal file
9
modules/common/README.md
Normal file
@ -0,0 +1,9 @@
|
||||
# Shared configurations
|
||||
|
||||
Developed and designed by Wyatt J. Miller, 2024
|
||||
|
||||
Licensed by the Mozilla Public License v2
|
||||
|
||||
## Synopsis
|
||||
|
||||
This is the directory that holds shared configuration files amongst computers that I own. They are called by the root `flake.nix` file.
|
30
modules/common/host-users.nix
Normal file
30
modules/common/host-users.nix
Normal file
@ -0,0 +1,30 @@
|
||||
{
|
||||
pkgs,
|
||||
userName,
|
||||
hostname,
|
||||
...
|
||||
} @ args: {
|
||||
# Set up networking configuration
|
||||
networking.hostName = hostname;
|
||||
# networking.computerName = hostname;
|
||||
# networking.firewall.enable = true; # VERY important, do not touch
|
||||
# networking.firewall.allowedTCPPorts = [];
|
||||
# networking.firewall.allowedUDPPorts = [];
|
||||
# networking.networkmanager.enable = pkgs.stdenv.isLinux; # Linux tool for managing network connections
|
||||
# system.defaults.smb.NetBIOSName = hostname;
|
||||
|
||||
# Set up user accounts
|
||||
# Don't forget to set a password with ‘passwd’!
|
||||
users.users."${userName}" = {
|
||||
home =
|
||||
if pkgs.stdenv.isDarwin
|
||||
then "/Users/${userName}"
|
||||
else "/home/${userName}";
|
||||
description = userName;
|
||||
group = "wyatt";
|
||||
isNormalUser = true;
|
||||
};
|
||||
users.groups.wyatt = {};
|
||||
|
||||
nix.settings.trusted-users = [userName];
|
||||
}
|
31
modules/common/nix-core.nix
Normal file
31
modules/common/nix-core.nix
Normal file
@ -0,0 +1,31 @@
|
||||
|
||||
{ pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
# enable flakes globally
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
|
||||
# Allow unfree packages
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
# Auto upgrade nix package and the daemon service.
|
||||
# services.nix-daemon.enable = true;
|
||||
# Use this instead of services.nix-daemon.enable if you
|
||||
# don't wan't the daemon service to be managed for you.
|
||||
# nix.useDaemon = true;
|
||||
|
||||
nix.package = pkgs.nix;
|
||||
|
||||
# do garbage collection weekly to keep disk usage low
|
||||
nix.gc = {
|
||||
automatic = lib.mkDefault true;
|
||||
options = lib.mkDefault "--delete-older-than 7d";
|
||||
};
|
||||
|
||||
# Disable auto-optimise-store because of this issue:
|
||||
# https://github.com/NixOS/nix/issues/7273
|
||||
# "error: cannot link '/nix/store/.tmp-link-xxxxx-xxxxx' to '/nix/store/.links/xxxx': File exists"
|
||||
nix.settings = {
|
||||
auto-optimise-store = false;
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user