This commit is contained in:
Sridhar Ratnakumar 2021-09-11 09:27:05 -04:00
parent 97bdd0158e
commit c17d5c4f12
4 changed files with 60 additions and 50 deletions

View file

@ -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

14
flake.lock generated
View file

@ -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"
}
},

View file

@ -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
];
};
}

View file

@ -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