Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
rasmus-kirk committed Sep 20, 2024
1 parent 3b15c93 commit 1c48c55
Show file tree
Hide file tree
Showing 5 changed files with 158 additions and 151 deletions.
14 changes: 7 additions & 7 deletions configurations/nixos/pi/age/secrets.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
let
key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDzC8fb2vPowh4zcDc9rI9upzHNm8dCvQwgCEAHKox9c";
key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDzC8fb2vPowh4zcDc9rI9upzHNm8dCvQwgCEAHKox9c";
in {
"airvpn-wg.conf.age".publicKeys = [ key ];
"domain.age".publicKeys = [ key ];
"njalla.age".publicKeys = [ key ];
"njalla-vpn.age".publicKeys = [ key ];
"user.age".publicKeys = [ key ];
"wifi.age".publicKeys = [ key ];
"airvpn-wg.conf.age".publicKeys = [key];
"domain.age".publicKeys = [key];
"njalla.age".publicKeys = [key];
"njalla-vpn.age".publicKeys = [key];
"user.age".publicKeys = [key];
"wifi.age".publicKeys = [key];
}
39 changes: 22 additions & 17 deletions configurations/nixos/pi/configuration.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{ inputs, config, pkgs, ... }:
let
{
inputs,
config,
pkgs,
...
}: let
machine = "pi";
username = "user";
dataDir = "/data";
Expand All @@ -11,7 +15,7 @@ let
in {
# Load secrets
age = {
identityPaths = [ "${secretDir}/pi/ssh/id_ed25519" ];
identityPaths = ["${secretDir}/pi/ssh/id_ed25519"];
secrets = {
"airvpn-wg.conf".file = ./age/airvpn-wg.conf.age;
wifi.file = ./age/wifi.age;
Expand All @@ -31,7 +35,7 @@ in {

nixarr = {
enable = true;
mediaUsers = [ username ];
mediaUsers = [username];

vpn = {
enable = true;
Expand Down Expand Up @@ -91,10 +95,12 @@ in {
systemd.services.systemd-journald.unitConfig.StartLimitIntervalSec = 0;

# Setup swap ram for stability
swapDevices = [ {
device = "/var/lib/swapfile";
size = 6*1024;
} ];
swapDevices = [
{
device = "/var/lib/swapfile";
size = 6 * 1024;
}
];

services = {
syncthing = {
Expand All @@ -112,7 +118,7 @@ in {
wireless = {
enable = true;
environmentFile = config.age.secrets.wifi.path;
networks."dd-wrt" = { psk = "@HOME@"; };
networks."dd-wrt" = {psk = "@HOME@";};
};
};

Expand All @@ -122,15 +128,15 @@ in {
shell = pkgs.zsh;
isNormalUser = true;
hashedPasswordFile = config.age.secrets.user.path;
extraGroups = [ "wheel" ];
extraGroups = ["wheel"];
};
};

services.openssh = {
enable = true;
openFirewall = true;
settings.PasswordAuthentication = false;
ports = [ 6000 ];
ports = [6000];
};
users.extraUsers."${username}".openssh.authorizedKeys.keyFiles = [
../../../pubkeys/work.pub
Expand All @@ -157,7 +163,7 @@ in {
# For security
execWheelOnly = true;
# For insults lol
package = pkgs.sudo.override { withInsults = true; };
package = pkgs.sudo.override {withInsults = true;};
extraConfig = ''
Defaults insults
'';
Expand All @@ -168,19 +174,19 @@ in {
"/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
options = [ "noatime" ];
options = ["noatime"];
};
"/data/media" = {
device = "/dev/disk/by-label/media";
fsType = "ext4";
options = [ "noatime" ];
options = ["noatime"];
};
};

# Force reboot on kernel panics
boot.kernelParams = [
"panic=10" # Reboot after 10 seconds of kernel panic
"panic_on_oops=1" # Reboot on any kernel oops (optional)
"panic=10" # Reboot after 10 seconds of kernel panic
"panic_on_oops=1" # Reboot on any kernel oops (optional)
];

environment.systemPackages = with pkgs; [
Expand Down Expand Up @@ -208,4 +214,3 @@ in {

system.stateVersion = "20.09";
}

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
./configurations/home-manager/pi/home.nix
self.homeManagerModules.default
];
config.home.packages = [ home-manager.packages."${system}".default ];
config.home.packages = [home-manager.packages."${system}".default];
};
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
Expand Down
2 changes: 1 addition & 1 deletion modules/home-manager/userDirs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ with lib; let
sort-downloads = pkgs.writeShellApplication {
name = "sort-downloads";

runtimeInputs = with pkgs; [ toybox ];
runtimeInputs = with pkgs; [toybox];

text = ''
downRoot="${config.xdg.userDirs.extraConfig.XDG_DOWNLOADS_ROOT}"
Expand Down
Loading

0 comments on commit 1c48c55

Please sign in to comment.