]> git.dujemihanovic.xyz Git - nixos-configuration.git/commitdiff
Separate config into server and laptop
authorDuje Mihanović <duje.mihanovic@skole.hr>
Fri, 15 Sep 2023 14:33:19 +0000 (16:33 +0200)
committerDuje Mihanović <duje.mihanovic@skole.hr>
Fri, 15 Sep 2023 14:33:19 +0000 (16:33 +0200)
.gitignore
configs/laptop.nix [new file with mode: 0644]
configs/server.nix [moved from configuration.nix with 85% similarity]
configuration.sample.nix [new file with mode: 0644]

index 577b0a0ecaf6efb11b850bb9d3f5ddca012d6561..2ee4098294a2cfd254ef9c6ce2acd3b4879b2af7 100644 (file)
@@ -1 +1,2 @@
+configuration.nix
 hardware-configuration.nix
diff --git a/configs/laptop.nix b/configs/laptop.nix
new file mode 100644 (file)
index 0000000..4af9965
--- /dev/null
@@ -0,0 +1,111 @@
+{ config, pkgs, ... }:
+
+{
+  networking.networkmanager.enable = true;
+  networking.wireless.enable = true;
+
+  time.timeZone = "Europe/Zagreb";
+
+  i18n.defaultLocale = "en_US.UTF-8";
+
+  i18n.extraLocaleSettings = {
+    LC_ADDRESS = "hr_HR.UTF-8";
+    LC_IDENTIFICATION = "hr_HR.UTF-8";
+    LC_MEASUREMENT = "hr_HR.UTF-8";
+    LC_MONETARY = "hr_HR.UTF-8";
+    LC_NAME = "hr_HR.UTF-8";
+    LC_NUMERIC = "hr_HR.UTF-8";
+    LC_PAPER = "hr_HR.UTF-8";
+    LC_TELEPHONE = "hr_HR.UTF-8";
+    LC_TIME = "hr_HR.UTF-8";
+  };
+
+  console = {
+    keyMap = "dvorak";
+    packages = with pkgs; [ terminus_font ];
+    font = "ter-124b";
+  };
+
+  services.xserver = {
+    enable = true;
+    desktopManager.gnome.enable = true;
+    displayManager.gdm.enable = true;
+  };
+
+  sound.enable = true;
+  hardware.pulseaudio.enable = false;
+  services.pipewire = {
+    enable = true;
+    audio.enable = true;
+    alsa.enable = true;
+    alsa.enable32Bit = true;
+    pulse.enable = true;
+  };
+
+  programs.zsh = {
+    enable = true;
+    autosuggestions.enable = true;
+    syntaxHighlighting.enable = true;
+  };
+
+  users.users.duje = {
+    isNormalUser = true;
+    description = "Duje";
+    extraGroups = [ "networkmanager" "wheel" ];
+    shell = pkgs.zsh;
+  };
+
+  nixpkgs.config.allowUnfree = true;
+
+  environment.systemPackages = with pkgs; [
+    neovim
+    lm_sensors
+    htop
+    nvimpager
+    tree
+    neofetch
+  ];
+
+  hardware.sensor.hddtemp = {
+    enable = true;
+    drives = [ "/dev/disk/by-path/*" ];
+  };
+
+  services.smartd.enable = true;
+  programs.msmtp = {
+    enable = true;
+    defaults = {
+      auth = true;
+      tls = true;
+      tls_starttls = true;
+      aliases = "/etc/aliases";
+    };
+    accounts = {
+      default = {
+       from = "duje.mihanovic@skole.hr";
+       host = "smtp.skole.hr";
+       port = 587;
+       user = "duje.mihanovic";
+       passwordeval = "/run/current-system/sw/bin/cat /secrets/email.txt";
+      };
+    };
+  };
+
+  environment.etc."aliases" = {
+    text = ''
+      root: duje.mihanovic@skole.hr
+      duje: duje.mihanovic@skole.hr
+      mailer-daemon: duje.mihanovic@skole.hr
+    '';
+    mode = "0644";
+  };
+
+  # Open ports in the firewall.
+  # networking.firewall.allowedTCPPorts = [ ... ];
+  # networking.firewall.allowedUDPPorts = [ ... ];
+  # Or disable the firewall altogether.
+  # networking.firewall.enable = false;
+
+  system.stateVersion = "23.05";
+
+}
similarity index 85%
rename from configuration.nix
rename to configs/server.nix
index b679930ecf5dbeb077b33ff1c221e0eb29edf2e1..672714844af080f28023d85b9103d4a10d8f327a 100644 (file)
@@ -1,26 +1,10 @@
 { config, pkgs, ... }:
 
 {
-  imports =
-    [
-      ./hardware-configuration.nix
-    ];
-
-  boot.loader.systemd-boot.enable = true;
-  boot.loader.efi.canTouchEfiVariables = true;
-
-  boot.extraModprobeConfig =
-    ''
-      options radeon si_support=0 cik_support=0
-      options amdgpu si_support=1 cik_support=1
-    '';
-
-  networking.hostName = "elitedesk"; # Define your hostname.
-  networking.interfaces.eno1.wakeOnLan.enable = true;
   systemd.network = {
     enable = true;
     networks."10-lan" = {
-      matchConfig.Name = "eno1";
+      matchConfig.Name = "*";
       DHCP = "yes";
       linkConfig.RequiredForOnline = "routable";
     };
diff --git a/configuration.sample.nix b/configuration.sample.nix
new file mode 100644 (file)
index 0000000..06832db
--- /dev/null
@@ -0,0 +1,17 @@
+{ config, pkgs, ... }:
+
+{
+  # Uncomment the respective config here.
+  imports =
+    [
+      ./hardware-configuration.nix
+      #./configs/server.nix
+      #./configs/laptop.nix
+    ];
+
+  # Enable EFI bootloader.
+  #boot.loader.systemd-boot.enable = true;
+  #boot.loader.efi.canTouchEfiVariables = true;
+
+  networking.hostName = "nixos"; # Define your hostname.
+}