about summary refs log tree commit diff
path: root/machines
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2020-12-11 12:11:45 +0100
committerPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2020-12-11 12:11:45 +0100
commit527c96af4ed48111cfa19161fb2680b6866c2594 (patch)
tree54fc683de97bb5a768598413cebae83553e4f7c1 /machines
parentbb668c1bdfb2937e2ca987426aac6cfe1b544fc9 (diff)
downloaddots-527c96af4ed48111cfa19161fb2680b6866c2594.tar.gz
dots-527c96af4ed48111cfa19161fb2680b6866c2594.zip
Add machines folder
Diffstat (limited to 'machines')
-rwxr-xr-xmachines/base.nix49
-rwxr-xr-xmachines/hp-compaq/configuration.nix22
-rwxr-xr-xmachines/hp-compaq/default.nix10
-rwxr-xr-xmachines/hp-compaq/hardware-configuration.nix37
-rwxr-xr-xmachines/pl.nix11
-rwxr-xr-xmachines/x220/hardware-configuration.nix33
6 files changed, 162 insertions, 0 deletions
diff --git a/machines/base.nix b/machines/base.nix
new file mode 100755
index 0000000..5976448
--- /dev/null
+++ b/machines/base.nix
@@ -0,0 +1,49 @@
+## Base setup, absolute minimum
+
+{ pkgs, ... }:
+{
+
+  imports = [
+    ../modules/nur.nix
+    ../users/pn.nix
+  ];
+
+  environment.systemPackages = with pkgs; [
+    wget vim curl htop file
+    stdenv git zip unzip
+    dnsutils ripgrep jq
+  ];
+
+  console.font = "${pkgs.terminus_font}/share/consolefonts/ter-v22n";
+
+  ## === Vim configuration ===
+  programs.vim.defaultEditor = true;
+  environment.etc."vim/vimrc".text = ''
+    set undodir=$XDG_DATA_HOME/vim/undo
+    set directory=$XDG_DATA_HOME/vim/swap
+    set backupdir=$XDG_DATA_HOME/vim/backup
+    set viewdir=$XDG_DATA_HOME/vim/view
+    set viminfo+='1000,n$XDG_DATA_HOME/vim/viminfo
+    set runtimepath=$XDG_CONFIG_HOME/vim,$VIMRUNTIME,$XDG_CONFIG_HOME/vim/after
+  '';
+
+  ## === ZSH configuration ===
+
+  ## Make zsh the default shell
+  users.defaultUserShell = "/run/current-system/sw/bin/zsh";
+
+  ## Cleanup home
+  environment.etc."zshenv.local".text = ''
+    export ZDOTDIR=$HOME/.config/zsh
+  '';
+
+  programs.zsh = {
+    enable = true;
+    enableCompletion = true;
+    autosuggestions.enable = true;
+    histFile = "$XDG_DATA_HOME/zsh/history";
+
+    syntaxHighlighting.enable = true;
+  };
+
+}
diff --git a/machines/hp-compaq/configuration.nix b/machines/hp-compaq/configuration.nix
new file mode 100755
index 0000000..958088c
--- /dev/null
+++ b/machines/hp-compaq/configuration.nix
@@ -0,0 +1,22 @@
+{ config, pkgs, ... }:
+
+{
+  imports =
+    [ # Include the results of the hardware scan.
+      ./hardware-configuration.nix
+    ];
+
+  boot.loader.grub.enable = true;
+  boot.loader.grub.version = 2;
+  boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only
+
+  networking.hostName = "hp-compaq";
+
+  networking.useDHCP = false;
+  networking.interfaces.enp2s0.useDHCP = true;
+
+  environment.systemPackages = with pkgs; [
+  ];
+
+}
+
diff --git a/machines/hp-compaq/default.nix b/machines/hp-compaq/default.nix
new file mode 100755
index 0000000..2b96276
--- /dev/null
+++ b/machines/hp-compaq/default.nix
@@ -0,0 +1,10 @@
+{
+	imports = [
+		./configuration.nix
+		./hardware-configuration.nix
+
+		../base.nix
+		../pl.nix
+		../../modules/larbs.nix
+	];
+}
diff --git a/machines/hp-compaq/hardware-configuration.nix b/machines/hp-compaq/hardware-configuration.nix
new file mode 100755
index 0000000..a2f8180
--- /dev/null
+++ b/machines/hp-compaq/hardware-configuration.nix
@@ -0,0 +1,37 @@
+# Do not modify this file!  It was generated by ‘nixos-generate-config’
+# and may be overwritten by future invocations.  Please make changes
+# to /etc/nixos/configuration.nix instead.
+{ config, lib, pkgs, ... }:
+
+{
+  imports =
+    [ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
+    ];
+
+  boot.initrd.availableKernelModules = [ "uhci_hcd" "ehci_pci" "ata_piix" "usb_storage" "usbhid" "sd_mod" "sr_mod" ];
+  boot.initrd.kernelModules = [ ];
+  boot.kernelModules = [ ];
+  boot.extraModulePackages = [ ];
+
+  fileSystems."/" =
+    { device = "/dev/disk/by-uuid/ad2775d5-5890-493e-b709-60c1f7f3c63b";
+      fsType = "ext4";
+    };
+
+  fileSystems."/nix/store" =
+    { device = "/nix/store";
+      fsType = "none";
+      options = [ "bind" ];
+    };
+
+  fileSystems."/boot" =
+    { device = "/dev/disk/by-uuid/C6DC-F51D";
+      fsType = "vfat";
+    };
+
+  swapDevices =
+    [ { device = "/dev/disk/by-uuid/ad2b96eb-341c-40e2-bb86-1ed2f03a0713"; }
+    ];
+
+  nix.maxJobs = lib.mkDefault 2;
+}
diff --git a/machines/pl.nix b/machines/pl.nix
new file mode 100755
index 0000000..14d8a5f
--- /dev/null
+++ b/machines/pl.nix
@@ -0,0 +1,11 @@
+## Configuration for writing in polish
+
+{
+  i18n.defaultLocale = "en_US.UTF-8"; # Less confusing locale than polish one
+
+  console.keyMap = "pl";
+
+  time.timeZone = "Europe/Warsaw";
+
+  services.xserver.layout = "pl";
+}
diff --git a/machines/x220/hardware-configuration.nix b/machines/x220/hardware-configuration.nix
new file mode 100755
index 0000000..3b34522
--- /dev/null
+++ b/machines/x220/hardware-configuration.nix
@@ -0,0 +1,33 @@
+# ThinkPad X220
+
+# Do not modify this file!  It was generated by ‘nixos-generate-config’
+# and may be overwritten by future invocations.  Please make changes
+# to /etc/nixos/configuration.nix instead.
+{ config, lib, pkgs, ... }:
+
+{
+  imports =
+    [ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
+    ];
+
+  boot.initrd.availableKernelModules = [ "ehci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci" ];
+  boot.initrd.kernelModules = [ ];
+  boot.kernelModules = [ "kvm-intel" "tp_smapi" ];
+  boot.extraModulePackages = with config.boot.kernelPackages; [ tp_smapi ];
+
+  fileSystems."/" =
+    { device = "/dev/disk/by-uuid/e00c989b-b3fd-469e-b894-ea609fb4d7fa";
+      fsType = "ext4";
+    };
+
+  fileSystems."/boot" =
+    { device = "/dev/disk/by-uuid/2f0948cd-a0de-41c0-a341-e9fe01460fd3";
+      fsType = "ext3";
+    };
+
+    swapDevices = [ {
+      device = "/dev/sda2"; } ];
+
+  nix.maxJobs = lib.mkDefault 4;
+  powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
+}