From c17d5c4f12911fa6b9f53fdbca2704f34b8453b5 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Sat, 11 Sep 2021 09:27:05 -0400 Subject: [PATCH] update.. --- Makefile | 6 +++++ flake.lock | 14 +++++------ flake.nix | 70 +++++++++++++++++++++++++++------------------------ hosts/p71.nix | 20 +++++++-------- 4 files changed, 60 insertions(+), 50 deletions(-) diff --git a/Makefile b/Makefile index 01d6fc9..868506b 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,8 @@ all: sudo nixos-rebuild switch && systemctl restart --user emanote + + +freeupboot: + # Delete all but the last few generations + sudo nix-env -p /nix/var/nix/profiles/system --delete-generations +5 + sudo nixos-rebuild boot diff --git a/flake.lock b/flake.lock index d3f47e5..7b190fd 100644 --- a/flake.lock +++ b/flake.lock @@ -134,11 +134,11 @@ "windicss": "windicss" }, "locked": { - "lastModified": 1630960993, - "narHash": "sha256-dDSWCY+3+7tG0ywX26Kw30mFm3hgYrORyQFIegU9jZ8=", + "lastModified": 1631224851, + "narHash": "sha256-eI11imyDg95pjkwOj46/b+RIWzzp+yPFtJBfMHfFSkY=", "owner": "srid", "repo": "emanote", - "rev": "5b70dfa0cbadffc0312e0281b97bcfae422d9cf1", + "rev": "cbff9a3704684988468a7e72b200842a8bc8c48d", "type": "github" }, "original": { @@ -601,17 +601,17 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1631015389, - "narHash": "sha256-9SKTwRbp7OQGa4wKTo1wB6ctC2VlaIeKFZ+flqzPuoI=", + "lastModified": 1631206977, + "narHash": "sha256-o3Dct9aJ5ht5UaTUBzXrRcK1RZt2eG5/xSlWJuUCVZM=", "owner": "nixos", "repo": "nixpkgs", - "rev": "bc06c93905f60a82d6ebbb78f78cf289257860cc", + "rev": "4f6d8095fd51954120a1d08ea5896fe42dc3923b", "type": "github" }, "original": { "owner": "nixos", "repo": "nixpkgs", - "rev": "bc06c93905f60a82d6ebbb78f78cf289257860cc", + "rev": "4f6d8095fd51954120a1d08ea5896fe42dc3923b", "type": "github" } }, diff --git a/flake.nix b/flake.nix index 4652b50..b4b083b 100644 --- a/flake.nix +++ b/flake.nix @@ -6,7 +6,7 @@ # https://status.nixos.org/ # # This ensures that we always use the official nix cache. - nixpkgs.url = "github:nixos/nixpkgs/bc06c93905f60a82d6ebbb78f78cf289257860cc"; + nixpkgs.url = "github:nixos/nixpkgs/4f6d8095fd51954120a1d08ea5896fe42dc3923b"; nixos-hardware.url = github:NixOS/nixos-hardware/master; home-manager.url = "github:nix-community/home-manager"; @@ -55,37 +55,41 @@ ); }; in - { - # The "name" in nixosConfigurations.${name} should match the `hostname` - # - nixosConfigurations.p71 = mkHomeMachine - ./hosts/p71.nix - [ - inputs.nixos-hardware.nixosModules.lenovo-thinkpad-p53 - ./features/desktopish - #./features/gnome.nix - ./features/desktopish/guiapps.nix - #./features/virtualbox.nix - #./features/server-mode.nix - # ./features/postgrest.nix - ./features/server/devserver.nix - ]; - nixosConfigurations.x1c7 = mkHomeMachine - ./hosts/x1c7.nix - [ - inputs.nixos-hardware.nixosModules.lenovo-thinkpad-x1-7th-gen - ./features/distributed-build.nix - ./features/gnome.nix - ./features/desktopish/guiapps.nix - ]; - nixosConfigurations.ryzen9 = mkHomeMachine - ./hosts/ryzen9.nix - [ - ./features/server/harden.nix - ./features/server/devserver.nix - ./features/ema/emanote.nix - ./features/lxd.nix - ]; - }; + { + # The "name" in nixosConfigurations.${name} should match the `hostname` + # + nixosConfigurations.p71 = mkHomeMachine + ./hosts/p71.nix + [ + inputs.nixos-hardware.nixosModules.lenovo-thinkpad-p53 + ./features/desktopish + #./features/gnome.nix + ./features/desktopish/guiapps.nix + ./features/server/devserver.nix + ./features/ema/emanote.nix + #./features/virtualbox.nix + ./features/lxd.nix + #./features/server-mode.nix + # ./features/postgrest.nix + ./features/server/devserver.nix + ./features/server/harden.nix + ]; + nixosConfigurations.x1c7 = mkHomeMachine + ./hosts/x1c7.nix + [ + inputs.nixos-hardware.nixosModules.lenovo-thinkpad-x1-7th-gen + ./features/distributed-build.nix + ./features/gnome.nix + ./features/desktopish/guiapps.nix + ]; + nixosConfigurations.ryzen9 = mkHomeMachine + ./hosts/ryzen9.nix + [ + ./features/server/harden.nix + ./features/server/devserver.nix + ./features/ema/emanote.nix + ./features/lxd.nix + ]; + }; } diff --git a/hosts/p71.nix b/hosts/p71.nix index 36f2ac7..a405d50 100644 --- a/hosts/p71.nix +++ b/hosts/p71.nix @@ -9,38 +9,39 @@ boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; + boot.kernelPackages = pkgs.linuxPackages_latest; boot.supportedFilesystems = [ "ntfs" ]; # https://notes.srid.ca/rtl8821cu boot.extraModulePackages = [ config.boot.kernelPackages.rtl8821cu ]; + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + fileSystems."/" = - { device = "/dev/disk/by-uuid/8d755446-15a4-4260-8a13-7529b585666b"; + { + device = "/dev/disk/by-uuid/8d755446-15a4-4260-8a13-7529b585666b"; fsType = "ext4"; }; boot.initrd.luks.devices."crypted".device = "/dev/disk/by-uuid/68eed875-bd65-4178-bca6-3e1db074ed46"; fileSystems."/boot" = - { device = "/dev/nvme0n1p1"; + { + device = "/dev/nvme0n1p1"; fsType = "vfat"; }; swapDevices = [ ]; - powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + # high-resolution display hardware.video.hidpi.enable = lib.mkDefault true; - hardware.pulseaudio.enable = true; hardware.pulseaudio.support32Bit = true; ## If compatibility with 32-bit applications is desired. services.xserver.videoDrivers = [ "nvidia" "intel" ]; - # Use the systemd-boot EFI boot loader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - # boot.kernelPackages = pkgs.linuxPackages_latest; - nixpkgs.config.allowUnfree = true; nix = { package = pkgs.nixFlakes; @@ -52,7 +53,6 @@ networking.hostName = "p71"; # Define your hostname. networking.networkmanager.enable = true; - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. # The global useDHCP flag is deprecated, therefore explicitly set to false here. # Per-interface useDHCP will be mandatory in the future, so this generated config