better way of unstable

This commit is contained in:
Tao Tien 2023-07-19 00:52:04 -07:00
parent 6cf6fb63f9
commit 02f4d09e37
4 changed files with 48 additions and 34 deletions

26
flake.lock generated
View file

@ -10,31 +10,45 @@
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "id": "nixos-hardware",
"repo": "nixos-hardware", "type": "indirect"
"type": "github"
} }
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1689605451, "lastModified": 1689605451,
"narHash": "sha256-u2qp2k9V1smCfk6rdUcgMKvBj3G9jVvaPHyeXinjN9E=", "narHash": "sha256-u2qp2k9V1smCfk6rdUcgMKvBj3G9jVvaPHyeXinjN9E=",
"owner": "Nixos", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "53657afe29748b3e462f1f892287b7e254c26d77", "rev": "53657afe29748b3e462f1f892287b7e254c26d77",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "Nixos", "id": "nixpkgs",
"ref": "nixos-23.05", "ref": "nixos-23.05",
"type": "indirect"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1689534811,
"narHash": "sha256-jnSUdzD/414d94plCyNlvTJJtiTogTep6t7ZgIKIHiE=",
"owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "6cee3b5893090b0f5f0a06b4cf42ca4e60e5d222",
"type": "github" "type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-unstable",
"type": "indirect"
} }
}, },
"root": { "root": {
"inputs": { "inputs": {
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable"
} }
} }
}, },

View file

@ -2,21 +2,30 @@
description = "we say NO to shitty OSes"; description = "we say NO to shitty OSes";
inputs = { inputs = {
nixpkgs.url = "github:Nixos/nixpkgs/nixos-23.05"; # nixpkgs.url = "github:Nixos/nixpkgs/nixos-23.05";
nixos-hardware.url = "github:NixOS/nixos-hardware"; # nixpkgs-unstable.url = "github:Nixos/nixpkgs/nixos-unstable";
# nixos-hardware.url = "github:NixOS/nixos-hardware";
nixpkgs.url = "nixpkgs/nixos-23.05";
nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
nixos-hardware.url = "nixos-hardware";
}; };
outputs = { nixpkgs, ... }@inputs: # outputs = { nixpkgs, ... }@inputs:
outputs = { nixpkgs, nixos-hardware, nixpkgs-unstable, ... }:
let let
# pkgs = import nixpkgs { # pkgs = import nixpkgs {
# config.allowUnfree = true; # config.allowUnfree = true;
# }; # };
nixosSystem = (systemModules: inputs.nixpkgs.lib.nixosSystem { modules = systemModules; }); overlay-unstable = final: prev: {
nixos-hw = inputs.nixos-hardware.nixosModules; unstable = nixpkgs-unstable.legacyPackages.x86_64-linux;
};
nixosSystem = (systemModules: nixpkgs.lib.nixosSystem { modules = systemModules; });
nixos-hw = nixos-hardware.nixosModules;
in in
{ {
nixosConfigurations = { nixosConfigurations = {
NOcomputer = nixosSystem [ NOcomputer = nixosSystem [
({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
nixos-hw.common-cpu-amd nixos-hw.common-cpu-amd
nixos-hw.common-gpu-nvidia-nonprime nixos-hw.common-gpu-nvidia-nonprime
./systems/BASED.nix ./systems/BASED.nix
@ -26,6 +35,7 @@
./users/tao.nix ./users/tao.nix
]; ];
NOlaptop = nixosSystem [ NOlaptop = nixosSystem [
({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
nixos-hw.common-cpu-intel nixos-hw.common-cpu-intel
# inputs.nixos-hardware.nixosModules.framework # inputs.nixos-hardware.nixosModules.framework
./systems/BASED.nix ./systems/BASED.nix

View file

@ -1,5 +1,7 @@
{ pkgs, ... }: { { pkgs, config, ... }:
environment.systemPackages = with pkgs; [ {
environment.systemPackages = with pkgs;
[
# mesa # mesa
openrgb openrgb
gwe gwe
@ -41,12 +43,10 @@
systemd.user.services.fans = { systemd.user.services.fans = {
description = "NZXT fans to 100% using liquidctl"; description = "NZXT fans to 100% using liquidctl";
# serviceConfig.User = "tao";
script = '' script = ''
${pkgs.liquidctl}/bin/liquidctl -m nzxt set sync speed 100 ${pkgs.liquidctl}/bin/liquidctl -m nzxt set sync speed 100
''; '';
wantedBy = [ "default.target" ]; wantedBy = [ "default.target" ];
# partOf = [ "graphical-session.target" ];
}; };
services.udev.packages = [ pkgs.openrgb ]; services.udev.packages = [ pkgs.openrgb ];
@ -55,6 +55,7 @@
SUBSYSTEM == "tty", GROUP="dialout", ATTRS{interface}=="Black Magic UART Port", SYMLINK+="ttyBmpTarg" SUBSYSTEM == "tty", GROUP="dialout", ATTRS{interface}=="Black Magic UART Port", SYMLINK+="ttyBmpTarg"
''; '';
# boot.kernelPackages = pkgs.linuxPackages_latest;
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
boot.kernelModules = [ "i2c-dev" "kvm-amd" ]; boot.kernelModules = [ "i2c-dev" "kvm-amd" ];
@ -65,9 +66,8 @@
}; };
hardware.nvidia = { hardware.nvidia = {
modesetting.enable = true; modesetting.enable = true;
# package = config.boot.kernelPackages.nvidiaPackages.vulkan_beta;
}; };
networking.hostName = "NOcomputer"; networking.hostName = "NOcomputer";
} }

View file

@ -1,7 +1,4 @@
{ pkgs, config, ... }: { pkgs, ... }:
let
unstableTarball = fetchTarball "https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz";
in
{ {
users.users.tao.packages = with pkgs; [ users.users.tao.packages = with pkgs; [
darktable darktable
@ -24,6 +21,7 @@ in
tio tio
unstable.nushell unstable.nushell
unstable.prusa-slicer unstable.prusa-slicer
unstable.wezterm
virt-manager virt-manager
zoxide zoxide
]; ];
@ -35,14 +33,6 @@ in
configDir = "/home/tao/.config/syncthing"; configDir = "/home/tao/.config/syncthing";
}; };
nixpkgs.config = {
packageOverrides = pkgs: {
unstable = import unstableTarball {
config = config.nixpkgs.config;
};
};
};
fonts.fonts = with pkgs; [ fonts.fonts = with pkgs; [
(nerdfonts.override { fonts = [ "FiraCode" ]; }) (nerdfonts.override { fonts = [ "FiraCode" ]; })
noto-fonts-cjk noto-fonts-cjk