summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--flake.lock27
-rw-r--r--flake.nix17
-rw-r--r--hosts/cez/configuration.nix (renamed from hosts/cez.nix)7
-rw-r--r--hosts/cez/hardware-configuration.nix38
-rw-r--r--hosts/common.nix (renamed from configuration.nix)17
-rw-r--r--hosts/kay/configuration.nix (renamed from hosts/kay.nix)5
-rw-r--r--hosts/kay/hardware-configuration.nix32
-rw-r--r--overlays/default.nix4
-rw-r--r--overlays/dwl-sinan/default.nix (renamed from overlays/dwl-sinan.nix)4
-rw-r--r--overlays/wmenu-cez/default.nix (renamed from overlays/wmenu-sinan.nix)4
11 files changed, 140 insertions, 16 deletions
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 577b0a0..0000000
--- a/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-hardware-configuration.nix
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000..e6cde03
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,27 @@
+{
+ "nodes": {
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1693565476,
+ "narHash": "sha256-ya00zHt7YbPo3ve/wNZ/6nts61xt7wK/APa6aZAfey0=",
+ "owner": "NixOs",
+ "repo": "nixpkgs",
+ "rev": "aa8aa7e2ea35ce655297e8322dc82bf77a31d04b",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOs",
+ "ref": "nixos-unstable",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "nixpkgs": "nixpkgs"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..93713c0
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,17 @@
+{
+ description = "reproducible nixos configuration with flakes";
+ inputs.nixpkgs.url = "github:NixOs/nixpkgs/nixos-unstable";
+
+ outputs = { self, nixpkgs }: {
+ nixosConfigurations = {
+ cez = nixpkgs.lib.nixosSystem {
+ system = "x86_64-linux";
+ modules = [ ./hosts/cez/configuration.nix ];
+ };
+ kay = nixpkgs.lib.nixosSystem {
+ system = "x86_64-linux";
+ modules = [ ./hosts/kay/configuration.nix ];
+ };
+ };
+ };
+}
diff --git a/hosts/cez.nix b/hosts/cez/configuration.nix
index bf9ffde..ac2d2ea 100644
--- a/hosts/cez.nix
+++ b/hosts/cez/configuration.nix
@@ -5,9 +5,10 @@ let
in
{
imports = [
- ../modules/wayland.nix
- ../modules/sshfs.nix
- ../modules/dev.nix
+ ./hardware-configuration.nix
+ ../../modules/wayland.nix
+ ../../modules/sshfs.nix
+ ../common.nix
];
boot = {
diff --git a/hosts/cez/hardware-configuration.nix b/hosts/cez/hardware-configuration.nix
new file mode 100644
index 0000000..70ad4aa
--- /dev/null
+++ b/hosts/cez/hardware-configuration.nix
@@ -0,0 +1,38 @@
+{ modulesPath, ... }:
+
+{
+ imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
+
+ boot = {
+ kernelModules = [ "kvm-amd" ];
+ initrd = {
+ availableKernelModules = [
+ "nvme"
+ "xhci_pci"
+ "ahci"
+ "usb_storage"
+ "sd_mod"
+ "sdhci_pci"
+ ];
+ luks.devices = {
+ "cryptroot".device = "/dev/disk/by-uuid/445abd75-6887-4b10-8483-a4be94f1fffd";
+ "crypthome".device = "/dev/disk/by-uuid/b1f57828-d0c3-4b0b-9d32-5e7e96651eda";
+ };
+ };
+ };
+
+ fileSystems = {
+ "/" = {
+ device = "/dev/disk/by-uuid/1df57eaf-50cd-405d-85ef-ccd1f2649227";
+ fsType = "ext4";
+ };
+ "/boot" = {
+ device = "/dev/disk/by-uuid/EE3C-1135";
+ fsType = "vfat";
+ };
+ "/home" = {
+ device = "/dev/disk/by-uuid/c6649ef3-f96d-4a11-ae20-d8d937d8a8e4";
+ fsType = "ext4";
+ };
+ };
+}
diff --git a/configuration.nix b/hosts/common.nix
index 3e76b9e..56f2953 100644
--- a/configuration.nix
+++ b/hosts/common.nix
@@ -6,9 +6,8 @@ let
in
{
imports = [
- ./hardware-configuration.nix # hw scan
- ./modules/userdata.nix
- ./hosts/cez.nix
+ ../modules/userdata.nix
+ ../modules/dev.nix
];
# boot
@@ -23,6 +22,7 @@ in
# networking
time.timeZone = "Asia/Kolkata";
+ networking.useDHCP = lib.mkDefault true;
# users
users.users.${user} = {
@@ -41,6 +41,7 @@ in
rtorrent
ps_mem
brightnessctl
+ neofetch
];
};
@@ -66,14 +67,10 @@ in
# nix
nix.settings.experimental-features = [
- "nix-command"
- "flakes"
+ "flakes"
+ "nix-command"
];
- nixpkgs.overlays = with builtins; lib.mkIf (pathExists ./overlays) (
- map
- (overlay: import ./overlays/${overlay})
- (attrNames (readDir ./overlays))
- );
+ nixpkgs.overlays = (import ../overlays);
# programs
programs = {
diff --git a/hosts/kay.nix b/hosts/kay/configuration.nix
index 49a17c0..8ad42c8 100644
--- a/hosts/kay.nix
+++ b/hosts/kay/configuration.nix
@@ -1,5 +1,10 @@
{ pkgs, ... }:
{
+ imports = [
+ ./hardware-configuration.nix
+ ../common.nix
+ ];
+
environment.systemPackages = with pkgs; [ tmux ];
}
diff --git a/hosts/kay/hardware-configuration.nix b/hosts/kay/hardware-configuration.nix
new file mode 100644
index 0000000..1583736
--- /dev/null
+++ b/hosts/kay/hardware-configuration.nix
@@ -0,0 +1,32 @@
+{ modulesPath, ... }:
+
+{
+ imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
+
+ boot = {
+ kernelModules = [ "kvm-intel" ];
+ initrd.availableKernelModules = [
+ "xhci_pci"
+ "ehci_pci"
+ "ahci"
+ "usb_storage"
+ "usbhid"
+ "sd_mod"
+ ];
+ };
+
+ fileSystems = {
+ "/" = {
+ device = "/dev/disk/by-uuid/2eeacf49-c51e-4229-bd4a-ae437014725f";
+ fsType = "ext4";
+ };
+ "/boot" = {
+ device = "/dev/disk/by-uuid/A902-90BB";
+ fsType = "vfat";
+ };
+ "/hdd" = {
+ device = "/dev/disk/by-uuid/c941edb4-e393-4254-bbef-d1b3728290e9";
+ fsType = "ext4";
+ };
+ };
+}
diff --git a/overlays/default.nix b/overlays/default.nix
new file mode 100644
index 0000000..b880f32
--- /dev/null
+++ b/overlays/default.nix
@@ -0,0 +1,4 @@
+[
+ (import ./dwl-sinan)
+ (import ./wmenu-cez)
+]
diff --git a/overlays/dwl-sinan.nix b/overlays/dwl-sinan/default.nix
index b3c39b0..ff5c999 100644
--- a/overlays/dwl-sinan.nix
+++ b/overlays/dwl-sinan/default.nix
@@ -1,4 +1,6 @@
-final: prev: {
+final: prev:
+
+{
dwl-sinan = prev.dwl.overrideAttrs (finalAttrs: prevAttrs:
{
pname = prevAttrs.pname + "-sinan";
diff --git a/overlays/wmenu-sinan.nix b/overlays/wmenu-cez/default.nix
index c525ab9..c304efb 100644
--- a/overlays/wmenu-sinan.nix
+++ b/overlays/wmenu-cez/default.nix
@@ -1,4 +1,6 @@
-final: prev: {
+final: prev:
+
+{
wmenu-sinan = prev.wmenu.overrideAttrs (finalAttrs: prevAttrs:
{
pname = prevAttrs.pname + "-sinan";