Compare commits
No commits in common. "0add03034e08a7c30fea783ef0edfd565559c234" and "342bb03515d017345a10453c4d42d4415f45957b" have entirely different histories.
0add03034e
...
342bb03515
|
@ -1,45 +1,32 @@
|
||||||
# Edit this configuration file to define what should be installed on
|
# Edit this configuration file to define what should be installed on
|
||||||
# your system. Help is available in the configuration.nix(5) man page
|
# your system. Help is available in the configuration.nix(5) man page
|
||||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||||
|
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
config,
|
imports =
|
||||||
pkgs,
|
[ # Include the results of the hardware scan.
|
||||||
...
|
./hardware-configuration.nix
|
||||||
}: {
|
];
|
||||||
imports = [
|
|
||||||
# Include the results of the hardware scan.
|
|
||||||
./hardware-configuration.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
services.postgresql = {
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||||
dataDir = "/pool/var/lib/postgresql/${config.services.postgresql.package.psqlSchema}";
|
|
||||||
};
|
|
||||||
|
|
||||||
nix.settings.experimental-features = ["nix-command" "flakes"];
|
|
||||||
powerManagement.enable = false;
|
powerManagement.enable = false;
|
||||||
|
|
||||||
# Bootloader.
|
# Bootloader.
|
||||||
boot.loader.grub.enable = true;
|
boot.loader.grub.enable = true;
|
||||||
boot.loader.grub.device = "/dev/sdc";
|
boot.loader.grub.device = "/dev/sdc";
|
||||||
boot.loader.grub.useOSProber = true;
|
boot.loader.grub.useOSProber = true;
|
||||||
networking = {
|
|
||||||
hostName = "nixos"; # Define your hostname.
|
|
||||||
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
|
||||||
|
|
||||||
# Configure network proxy if necessary
|
networking.hostName = "nixos"; # Define your hostname.
|
||||||
# networking.proxy.default = "http://user:password@proxy:port/";
|
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||||
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
|
||||||
|
|
||||||
# Enable networking
|
# Configure network proxy if necessary
|
||||||
networkmanager.enable = true;
|
# networking.proxy.default = "http://user:password@proxy:port/";
|
||||||
|
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
||||||
|
|
||||||
# Open ports in the firewall.
|
# Enable networking
|
||||||
firewall.allowedTCPPorts = [80 443];
|
networking.networkmanager.enable = true;
|
||||||
|
|
||||||
extraHosts = ''
|
|
||||||
192.168.1.88 nas
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
# Set your time zone.
|
# Set your time zone.
|
||||||
time.timeZone = "Europe/Stockholm";
|
time.timeZone = "Europe/Stockholm";
|
||||||
|
@ -107,10 +94,10 @@
|
||||||
users.users.sondell = {
|
users.users.sondell = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
description = "sondell";
|
description = "sondell";
|
||||||
extraGroups = ["networkmanager" "wheel"];
|
extraGroups = [ "networkmanager" "wheel" ];
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
firefox
|
firefox
|
||||||
# thunderbird
|
# thunderbird
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -119,14 +106,15 @@
|
||||||
openssh.authorizedKeys.keys = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMYGJCpFIiWqzy8YbfWh7+i52XVwyhUu+P0rUglVR5uV gws@nixos"];
|
openssh.authorizedKeys.keys = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMYGJCpFIiWqzy8YbfWh7+i52XVwyhUu+P0rUglVR5uV gws@nixos"];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
# Allow unfree packages
|
# Allow unfree packages
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
# List packages installed in system profile. To search, run:
|
# List packages installed in system profile. To search, run:
|
||||||
# $ nix search wget
|
# $ nix search wget
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
|
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
|
||||||
# wget
|
# wget
|
||||||
htop
|
htop
|
||||||
cloudflared
|
cloudflared
|
||||||
filebrowser
|
filebrowser
|
||||||
|
@ -138,21 +126,18 @@
|
||||||
nil
|
nil
|
||||||
starship
|
starship
|
||||||
tailscale
|
tailscale
|
||||||
alejandra
|
|
||||||
];
|
];
|
||||||
programs = {
|
|
||||||
ssh.startAgent = true;
|
programs.fish= {
|
||||||
fish = {
|
enable=true;
|
||||||
enable = true;
|
shellInit = "starship init fish | source";
|
||||||
shellInit = "starship init fish | source";
|
};
|
||||||
};
|
programs.starship.enable = true;
|
||||||
starship.enable = true;
|
programs.starship.settings = {
|
||||||
starship.settings = {
|
shell = {
|
||||||
shell = {
|
disabled = false;
|
||||||
disabled = false;
|
fish_indicator = "";
|
||||||
fish_indicator = "";
|
bash_indicator = "BASH";
|
||||||
bash_indicator = "BASH";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -175,11 +160,14 @@
|
||||||
defaults = {
|
defaults = {
|
||||||
email = "glennpub@proton.me";
|
email = "glennpub@proton.me";
|
||||||
dnsProvider = "cloudflare";
|
dnsProvider = "cloudflare";
|
||||||
# # location of your CLOUDFLARE_DNS_API_TOKEN=[value]
|
# # location of your CLOUDFLARE_DNS_API_TOKEN=[value]
|
||||||
# # https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#EnvironmentFile=
|
# # https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#EnvironmentFile=
|
||||||
environmentFile = "/etc/nixos/.secrets/cloudflare_dns_tokend";
|
environmentFile = "/etc/nixos/.secrets/cloudflare_dns_tokend";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Open ports in the firewall.
|
||||||
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||||
# Or disable the firewall altogether.
|
# Or disable the firewall altogether.
|
||||||
|
@ -192,4 +180,5 @@
|
||||||
# Before changing this value read the documentation for this option
|
# Before changing this value read the documentation for this option
|
||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||||
system.stateVersion = "23.11"; # Did you read the comment?
|
system.stateVersion = "23.11"; # Did you read the comment?
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ in
|
||||||
After="network-online.target";
|
After="network-online.target";
|
||||||
};
|
};
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = "${filebrowser}/bin/filebrowser -r /pool/media/ -d /var/lib/filebrowser/filebrowser.db";
|
ExecStart = "${filebrowser}/bin/filebrowser -r /mnt/movie_drive -d /var/lib/filebrowser/filebrowser.db";
|
||||||
User= "jellyfin";
|
User= "jellyfin";
|
||||||
Type= "simple";
|
Type= "simple";
|
||||||
};
|
};
|
||||||
|
|
|
@ -58,11 +58,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1713880523,
|
"lastModified": 1712745070,
|
||||||
"narHash": "sha256-/dMwfs3toYi2SzrItwpTLKWMSIquAptdCClC2FB608Y=",
|
"narHash": "sha256-75kSMjyCD5/IliSPkBcBSBamwPYF30Ddr8Ef2XxDfiE=",
|
||||||
"ref": "refs/heads/main",
|
"ref": "refs/heads/main",
|
||||||
"rev": "5e986b284d6a7b81fd437822f6279dd915494c54",
|
"rev": "c2650ecab1c7b9b2e10d690b40e82817d257b53a",
|
||||||
"revCount": 29,
|
"revCount": 28,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.sondell.org/glennwso/home.git"
|
"url": "https://git.sondell.org/glennwso/home.git"
|
||||||
},
|
},
|
||||||
|
|
|
@ -30,7 +30,6 @@
|
||||||
./tail.nix
|
./tail.nix
|
||||||
./matrix.nix
|
./matrix.nix
|
||||||
./coturn.nix
|
./coturn.nix
|
||||||
./vaultwarden.nix
|
|
||||||
(import ./mail.nix {inherit mailserver;})
|
(import ./mail.nix {inherit mailserver;})
|
||||||
(import ./homepage.nix {inherit homepage;})
|
(import ./homepage.nix {inherit homepage;})
|
||||||
];
|
];
|
||||||
|
|
|
@ -7,7 +7,6 @@ in
|
||||||
{
|
{
|
||||||
services.forgejo = {
|
services.forgejo = {
|
||||||
enable = true;
|
enable = true;
|
||||||
stateDir = "/pool/var/lib/forgejo";
|
|
||||||
settings = {
|
settings = {
|
||||||
service = {
|
service = {
|
||||||
# DISABLE_REGISTRATION = true;
|
# DISABLE_REGISTRATION = true;
|
||||||
|
|
|
@ -21,10 +21,7 @@
|
||||||
{ device = "/dev/disk/by-uuid/f3463885-fde8-4488-9442-37ced2b2c8f3";
|
{ device = "/dev/disk/by-uuid/f3463885-fde8-4488-9442-37ced2b2c8f3";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
};
|
};
|
||||||
fileSystems."/pool" = {
|
|
||||||
device = "/dev/pool1/vol1";
|
|
||||||
fsType = "ext4";
|
|
||||||
};
|
|
||||||
|
|
||||||
swapDevices = [ ];
|
swapDevices = [ ];
|
||||||
|
|
||||||
|
|
|
@ -8,27 +8,6 @@ in
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
nextcloud
|
nextcloud
|
||||||
];
|
];
|
||||||
systemd.timers."nextcloud-backup" = {
|
|
||||||
wantedBy = [ "timers.target" ];
|
|
||||||
timerConfig = {
|
|
||||||
# OnBootSec = "5m";
|
|
||||||
# OnUnitActiveSec = "5m";
|
|
||||||
OnCalendar="*-*-* 2:00:00";
|
|
||||||
Unit = "nextcloud-backup.service";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services."nextcloud-backup" = {
|
|
||||||
script = with pkgs; ''
|
|
||||||
set -eu
|
|
||||||
${postgresql}/bin/pg_dump "nextcloud" | ${openssh}/bin/ssh -i /etc/nixos/.secrets/tulpan Glenn@nas "cat - > back/nextcloud/dump.sql"
|
|
||||||
'';
|
|
||||||
serviceConfig = {
|
|
||||||
Type = "oneshot";
|
|
||||||
User = "postgres";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
nginx.virtualHosts = {
|
nginx.virtualHosts = {
|
||||||
${domain} = {
|
${domain} = {
|
||||||
|
|
|
@ -1,22 +0,0 @@
|
||||||
{ ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
domain = "pw.sondell.org";
|
|
||||||
port = "8222";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
#
|
|
||||||
services.vaultwarden = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
services.nginx.virtualHosts.${domain} = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "http://localhost:${port}/";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue