fmt: alejandra

This commit is contained in:
♥ Minnie ♥ 2024-08-08 09:02:42 +08:00
parent 53378cdfc9
commit 3350d19a45
Signed by: jasmine
GPG key ID: 8563E358D4E8040E
79 changed files with 432 additions and 511 deletions

View file

@ -1,8 +1,11 @@
{ config, pkgs, inputs, ... }:
let
hostname = config.networking.hostName;
in
{
config,
pkgs,
inputs,
...
}: let
hostname = config.networking.hostName;
in {
imports = [
inputs.agenix.nixosModules.default
inputs.agenix-rekey.nixosModules.default
@ -20,7 +23,7 @@ in
# Pubkey for rekeying
hostPubkey = ../../${hostname}/ssh_host_ed25519_key.pub;
# Master identity used for decryption
masterIdentities = [ ../users/sajenim/agenix-rekey.pub ];
masterIdentities = [../users/sajenim/agenix-rekey.pub];
# Where we store the rekeyed secrets
storageMode = "local";
localStorageDir = ./. + "/secrets/rekeyed/${config.networking.hostName}";

View file

@ -1,6 +1,4 @@
{ outputs, ... }:
{
{outputs, ...}: {
imports = [
./age.nix
./env.nix

View file

@ -1,35 +1,33 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
environment = {
binsh = "${pkgs.bash}/bin/bash";
shells = with pkgs; [ zsh ];
shells = with pkgs; [zsh];
systemPackages = with pkgs; [
# Ensure home-manager is on all systems
home-manager
# Useful system utilities
tree # directory structure
bc # basic calculator
vim # editor
ranger # console file manager
htop # system monitor
scrot # screenshot
direnv # load environment
jq # JSON processor
git # version control
nmap # network mapper
xclip # clipboard
tree # directory structure
bc # basic calculator
vim # editor
ranger # console file manager
htop # system monitor
scrot # screenshot
direnv # load environment
jq # JSON processor
git # version control
nmap # network mapper
xclip # clipboard
ripgrep # searches the current directory for a regex pattern
# HTTP
curl # transfer dato to/from server
wget # download files from web
curl # transfer dato to/from server
wget # download files from web
# Archive
unrar # extract roshal archive
unzip # extract zip archive
unrar # extract roshal archive
unzip # extract zip archive
];
pathsToLink = [ "/share/zsh" ];
pathsToLink = ["/share/zsh"];
};
}

View file

@ -1,6 +1,9 @@
{ config, inputs, lib, ... }:
{
config,
inputs,
lib,
...
}: {
nix = {
gc = {
# Automatically run the garbage collector an a specified time.
@ -11,7 +14,7 @@
# This will add each flake input as a registry
# To make nix commands consistent with your flake
registry = lib.mapAttrs (_: value: { flake = value; }) inputs;
registry = lib.mapAttrs (_: value: {flake = value;}) inputs;
# This will additionally add your inputs to the system's legacy channels
# Making legacy nix commands consistent as well, awesome!

View file

@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
services.openssh = {
enable = true;
settings = {
@ -8,7 +6,7 @@
PasswordAuthentication = false;
LogLevel = "VERBOSE";
};
ports = [ 22 ];
ports = [22];
openFirewall = true;
};

View file

@ -1,8 +1,10 @@
{ lib, config, ... }:
let
hostname = config.networking.hostName;
in
{
lib,
config,
...
}: let
hostname = config.networking.hostName;
in {
imports = [
./persist.nix
];
@ -36,26 +38,26 @@ in
"/" = {
device = "/dev/disk/by-label/${hostname}";
fsType = "btrfs";
options = [ "subvol=root" "compress=zstd" ];
options = ["subvol=root" "compress=zstd"];
};
"/nix" = {
device = "/dev/disk/by-label/${hostname}";
fsType = "btrfs";
options = [ "subvol=nix" "compress=zstd" ];
options = ["subvol=nix" "compress=zstd"];
};
"/persist" = {
device = "/dev/disk/by-label/${hostname}";
fsType = "btrfs";
options = [ "subvol=persist" "compress=zstd" ];
options = ["subvol=persist" "compress=zstd"];
neededForBoot = true;
};
"/swap" = {
device = "/dev/disk/by-label/${hostname}";
fsType = "btrfs";
options = [ "subvol=swap" "compress=zstd" ];
options = ["subvol=swap" "compress=zstd"];
};
};
}

View file

@ -1,6 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
environment.systemPackages = with pkgs; [
# Enables files to be encrypted to age identities stored on YubiKeys
age-plugin-yubikey
@ -17,7 +15,7 @@
pinentryPackage = pkgs.pinentry-curses;
};
# Use our yubikey as a user login or for sudo access
# Use our yubikey as a user login or for sudo access
security.pam.services = {
login.u2fAuth = true;
sudo.u2fAuth = true;

View file

@ -1,6 +1,4 @@
{ inputs, ... }:
{
{inputs, ...}: {
imports = [
inputs.impermanence.nixosModules.impermanence
];

View file

@ -1,22 +1,26 @@
{ inputs, outputs, pkgs, config, ... }:
{
inputs,
outputs,
pkgs,
config,
...
}: {
imports = [
inputs.home-manager.nixosModules.home-manager
];
users.users.sajenim = {
isNormalUser = true;
extraGroups = [ "audio" "docker" "networkmanager" "wheel" "adbusers" ];
shell = pkgs.zsh;
openssh.authorizedKeys.keyFiles = [
"${inputs.self}/home-manager/sajenim/sajenim_sk.pub"
];
hashedPassword = "$y$j9T$qIhW5qL9J9w.w6JWa.bGo/$oddG3HJyOZ1mwHzYnYPJ/MzN38oHEBEvPDc0sB3rAf9";
isNormalUser = true;
extraGroups = ["audio" "docker" "networkmanager" "wheel" "adbusers"];
shell = pkgs.zsh;
openssh.authorizedKeys.keyFiles = [
"${inputs.self}/home-manager/sajenim/sajenim_sk.pub"
];
hashedPassword = "$y$j9T$qIhW5qL9J9w.w6JWa.bGo/$oddG3HJyOZ1mwHzYnYPJ/MzN38oHEBEvPDc0sB3rAf9";
};
users.mutableUsers = false;
home-manager = {
extraSpecialArgs = { inherit inputs outputs; };
extraSpecialArgs = {inherit inputs outputs;};
users = {
sajenim = import "${inputs.self}/home-manager/sajenim/${config.networking.hostName}.nix";
};

View file

@ -1,12 +1,14 @@
{ pkgs, config, ... }:
{
pkgs,
config,
...
}: {
age.secrets.smb-secrets = {
rekeyFile = ./smb-secrets.age;
};
# For mount.cifs, required unless domain name resolution is not needed.
environment.systemPackages = [ pkgs.cifs-utils ];
environment.systemPackages = [pkgs.cifs-utils];
fileSystems."/home/sajenim/.backup" = {
device = "//192.168.20.4/sajenim";
@ -14,12 +16,10 @@
options = let
# this line prevents hanging on network split
automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s,user,users";
in ["${automount_opts},credentials=/etc/nixos/smb-secrets,uid=1000,gid=100"];
in ["${automount_opts},credentials=/etc/nixos/smb-secrets,uid=1000,gid=100"];
};
environment.etc = {
"nixos/smb-secrets".source = config.age.secrets.smb-secrets.path;
};
}

View file

@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
fileSystems."/home/sajenim/.local/share/Steam" = {
device = "/dev/disk/by-label/data";
fsType = "btrfs";

View file

@ -1,13 +1,15 @@
{ inputs, pkgs, ... }:
{
inputs,
pkgs,
...
}: {
imports = [
inputs.home-manager.nixosModules.home-manager
];
users.users.spectre = {
isNormalUser = true;
shell = pkgs.zsh;
hashedPassword = "$y$j9T$eCJ0MDPsx3tww9LP0LU8..$sE8u5keO7QNKNAR1t2R6GqsDzvGD0Xn9Fi3to14Gf9/";
isNormalUser = true;
shell = pkgs.zsh;
hashedPassword = "$y$j9T$eCJ0MDPsx3tww9LP0LU8..$sE8u5keO7QNKNAR1t2R6GqsDzvGD0Xn9Fi3to14Gf9/";
};
users.mutableUsers = false;
}