diff --git a/configuration.nix b/configuration.nix index fcde464..fe72954 100644 --- a/configuration.nix +++ b/configuration.nix @@ -20,7 +20,6 @@ # Define on which hard drive you want to install Grub. boot.loader.grub.device = "/dev/vda"; # or "nodev" for efi only - networking.hostName = "nixbox"; # Define your hostname. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. # Set your time zone. diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..a295407 --- /dev/null +++ b/flake.lock @@ -0,0 +1,77 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": "nixpkgs", + "utils": "utils" + }, + "locked": { + "lastModified": 1658151168, + "narHash": "sha256-0uHoOHr20pJTOGzgS4kNgOP4wfrch0fc+9vZ/6LgD44=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "4a724cb84cc3aa464af1713d11bf0cfbbdb56c00", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1654230545, + "narHash": "sha256-8Vlwf0x8ow6pPOK2a04bT+pxIeRnM1+O0Xv9/CuDzRs=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "236cc2971ac72acd90f0ae3a797f9f83098b17ec", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1658174584, + "narHash": "sha256-gLWmjLdk43pjagKnjOI/CgjKEVFgcOLNL0E0Kw7KasI=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "1715c13faa2632c0157435babda955fbc3e27cd7", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixpkgs": "nixpkgs_2" + } + }, + "utils": { + "locked": { + "lastModified": 1653893745, + "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..c4191e7 --- /dev/null +++ b/flake.nix @@ -0,0 +1,20 @@ +{ + description = "A very basic flake"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs"; + home-manager.url = "github:nix-community/home-manager"; + }; + + outputs = { self, nixpkgs, home-manager }: { + nixosConfigurations.nixbox = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + home-manager.nixosModule + ./configuration.nix + ./rices/cwm.nix + ./hardware.nix + ]; + }; + }; +} diff --git a/hardware.nix b/hardware.nix new file mode 100644 index 0000000..02d7a60 --- /dev/null +++ b/hardware.nix @@ -0,0 +1,34 @@ +# 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, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/profiles/qemu-guest.nix") ]; + + # Use the systemd-boot EFI boot loader. + boot.loader.grub = { + enable = true; + version = 2; + device = "/dev/vda"; + }; + networking.hostName = "nixbox"; # Define your hostname. + + boot.initrd.availableKernelModules = [ + "ahci" "xhci_pci" "virtio_pci" + "sr_mod" "virtio_blk" + ]; + + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-label/nixos"; + fsType = "ext4"; + }; + networking.useDHCP = lib.mkDefault true; + + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/rices/bspwm.nix b/rices/bspwm.nix index 4af46c6..27e1965 100644 --- a/rices/bspwm.nix +++ b/rices/bspwm.nix @@ -1,12 +1,5 @@ { config, pkgs, ... }: -let - home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/master.tar.gz"; -in { - imports = [ - (import "${home-manager}/nixos") - ]; - services.xserver.displayManager.startx.enable = true; home-manager.users.junikim = { diff --git a/rices/cwm.nix b/rices/cwm.nix index 0bb0810..6cf43fb 100644 --- a/rices/cwm.nix +++ b/rices/cwm.nix @@ -1,12 +1,5 @@ { config, pkgs, ... }: -let - home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/master.tar.gz"; -in { - imports = [ - (import "${home-manager}/nixos") - ]; - services.xserver.displayManager.startx.enable = true; home-manager.users.junikim = { diff --git a/rices/gnome.nix b/rices/gnome.nix index b40e9f4..3b02f9c 100644 --- a/rices/gnome.nix +++ b/rices/gnome.nix @@ -1,12 +1,5 @@ { config, pkgs, ... }: -let - home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/master.tar.gz"; -in { - imports = [ - (import "${home-manager}/nixos") - ]; - services.xserver.displayManager.gdm.enable = true; services.xserver.desktopManager.gnome.enable = true;