added nas hostname

This commit is contained in:
glenn 2024-05-05 20:53:16 +02:00
parent 642d297710
commit 2d8b2e985a

View file

@ -1,37 +1,45 @@
# 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, ... }:
{ {
imports = config,
[ # Include the results of the hardware scan. pkgs,
./hardware-configuration.nix ...
]; }: {
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
];
services.postgresql = { services.postgresql = {
dataDir = "/pool/var/lib/postgresql/${config.services.postgresql.package.psqlSchema}"; dataDir = "/pool/var/lib/postgresql/${config.services.postgresql.package.psqlSchema}";
}; };
nix.settings.experimental-features = [ "nix-command" "flakes" ]; 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.
networking.hostName = "nixos"; # Define your hostname. # Configure network proxy if necessary
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. # networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Configure network proxy if necessary # Enable networking
# networking.proxy.default = "http://user:password@proxy:port/"; networkmanager.enable = true;
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Enable networking # Open ports in the firewall.
networking.networkmanager.enable = true; firewall.allowedTCPPorts = [80 443];
extraHosts = ''
192.168.1.88 nas
'';
};
# Set your time zone. # Set your time zone.
time.timeZone = "Europe/Stockholm"; time.timeZone = "Europe/Stockholm";
@ -99,10 +107,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
]; ];
}; };
@ -111,15 +119,14 @@
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
@ -133,22 +140,21 @@
tailscale tailscale
alejandra alejandra
]; ];
programs = { programs = {
ssh.startAgent = true;
ssh.startAgent = true; fish = {
fish= { enable = true;
enable=true; shellInit = "starship init fish | source";
shellInit = "starship init fish | source"; };
}; starship.enable = true;
starship.enable = true; starship.settings = {
starship.settings = { shell = {
shell = { disabled = false;
disabled = false; fish_indicator = "";
fish_indicator = ""; bash_indicator = "BASH";
bash_indicator = "BASH"; };
}; };
}; };
};
# Some programs need SUID wrappers, can be configured further or are # Some programs need SUID wrappers, can be configured further or are
# started in user sessions. # started in user sessions.
@ -169,14 +175,11 @@ programs = {
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.
@ -189,5 +192,4 @@ programs = {
# 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?
} }