added nas hostname

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

View file

@ -1,29 +1,29 @@
# 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,
...
}: {
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix ./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 = {
networking.hostName = "nixos"; # Define your hostname. hostName = "nixos"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary # Configure network proxy if necessary
@ -31,7 +31,15 @@
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Enable networking # Enable networking
networking.networkmanager.enable = true; networkmanager.enable = true;
# Open ports in the firewall.
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,7 +107,7 @@
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,7 +119,6 @@
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;
@ -133,11 +140,10 @@
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;
@ -148,7 +154,7 @@ programs = {
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.
@ -174,9 +180,6 @@ programs = {
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?
} }