diff --git a/.gitignore b/.gitignore index af4639f..5e943bc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ .environment .firefox_env -hardware-configuration.nix diff --git a/boxes/virtbox.nix b/boxes/virtbox.nix index 9ae3730..5e7f5d0 100644 --- a/boxes/virtbox.nix +++ b/boxes/virtbox.nix @@ -1,10 +1,6 @@ { lib, config, pkgs, ...}: { - imports = [ - ../common/desktop.nix - ]; - boot.loader.grub.enable = true; boot.loader.grub.device = "/dev/vda"; diff --git a/common/desktop.nix b/common/desktop.nix index cf752e4..3ae124f 100644 --- a/common/desktop.nix +++ b/common/desktop.nix @@ -1,18 +1,13 @@ -{ lib, config, pkgs, ...}: +{ lib, config, pkgs, home-manager, ...}: let - home-manager = builtins.fetchTarball { - url = "https://github.com/nix-community/home-manager/archive/release-23.11.tar.gz"; - sha256 = "16078fwcmqq41dqfnm124xxm8l6zykvqlj1kzgi0fvfil4y86slm"; - }; customPolybar = pkgs.polybar.override { alsaSupport = true; pulseSupport = true; }; in { imports = [ - "${builtins.fetchTarball "https://github.com/Mic92/sops-nix/archive/master.tar.gz"}/modules/sops" - (import "${home-manager}/nixos") + home-manager.nixosModules.default ./main.nix ]; diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..21b8772 --- /dev/null +++ b/flake.lock @@ -0,0 +1,49 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1702814678, + "narHash": "sha256-zDtO0jV2QLoddUJinLlTQrQqCUW3dPiIWOSYgg98T7E=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "1488651d02c1a7a15e284210f0d380a62d8d8cef", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-23.11", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1702921762, + "narHash": "sha256-O/rP7gulApQAB47u6szEd8Pn8Biw0d84j5iuP2tcxzY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d02ffbbe834b5599fc5f134e644e49397eb07188", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-23.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix index 91db03d..4f17b49 100644 --- a/flake.nix +++ b/flake.nix @@ -9,7 +9,7 @@ }; }; - outputs = { self, nixpkgs, ... }@inputs: { + outputs = { self, nixpkgs, home-manager, ... }@inputs: { nixosConfigurations = { virtbox = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; @@ -17,6 +17,7 @@ modules = [ ./bootstrap.nix ./boxes/virtbox.nix + ./common/desktop.nix ]; }; }; diff --git a/hardware-configuration.nix b/hardware-configuration.nix new file mode 100644 index 0000000..c2a86c1 --- /dev/null +++ b/hardware-configuration.nix @@ -0,0 +1,31 @@ +# 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") + ]; + + 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-uuid/7b70ab88-296c-4737-90b2-267cb2432dc1"; + fsType = "ext4"; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp1s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +}