diff --git a/.github/workflows/cachix.yml b/.github/workflows/cachix.yml new file mode 100644 index 0000000..106da09 --- /dev/null +++ b/.github/workflows/cachix.yml @@ -0,0 +1,35 @@ +name: Cachix build + +on: + push: + workflow_dispatch: + +jobs: + linux: + name: Build Linux + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.3.4 + - uses: cachix/install-nix-action@v13 + with: + install_url: https://github.com/numtide/nix-flakes-installer/releases/download/nix-3.0pre20201007_5257a25/install + extra_nix_config: experimental-features = nix-command flakes + - uses: cachix/cachix-action@v10 + with: + name: lava + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - run: nix build .#linux-lava + wine: + name: Build Wine + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.3.4 + - uses: cachix/install-nix-action@v13 + with: + install_url: https://github.com/numtide/nix-flakes-installer/releases/download/nix-3.0pre20201007_5257a25/install + extra_nix_config: experimental-features = nix-command flakes + - uses: cachix/cachix-action@v10 + with: + name: lava + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - run: nix build .#wine-osu diff --git a/flake.nix b/flake.nix index f8e5eed..8a81322 100644 --- a/flake.nix +++ b/flake.nix @@ -12,6 +12,7 @@ base = { system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev; nix.registry.nixpkgs.flake = nixpkgs; + nixpkgs.overlays = builtins.attrValues overlays; }; hm-base = { home-manager.useGlobalPkgs = true; @@ -44,7 +45,17 @@ ./hosts/winter secrets.nixosModules.winter ]; - specialArgs = { inherit inputs overlays; }; + specialArgs = { inherit overlays; }; }; + + packages.x86_64-linux = + let + pkgs = import nixpkgs { + overlays = builtins.attrValues overlays; + system = "x86_64-linux"; + }; + in { + inherit (pkgs) linux-lava wine-osu; + }; }; } diff --git a/hosts/winter/default.nix b/hosts/winter/default.nix index ef742a2..46dbb1a 100644 --- a/hosts/winter/default.nix +++ b/hosts/winter/default.nix @@ -23,20 +23,22 @@ ../../users/rin ]; - nix = { + nix = rec { package = pkgs.nixUnstable; + binaryCaches = [ + "https://cache.nixos.org?priority=10" + "https://lava.cachix.org" + ]; + binaryCachePublicKeys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "lava.cachix.org-1:8lTWI/3IKWHByzzYHZySunMPYs2eAJw2duL+uLZkSy0=" + ]; + trustedBinaryCaches = binaryCaches; + extraOptions = '' experimental-features = nix-command flakes ''; }; - nixpkgs.overlays = with overlays; [ - discord - linux - polybar - picom - wine-osu - winetricks - ]; nixpkgs.config.allowUnfree = true; i18n.defaultLocale = "en_GB.UTF-8"; diff --git a/hosts/winter/kernel.nix b/hosts/winter/kernel.nix index 3587527..084251b 100644 --- a/hosts/winter/kernel.nix +++ b/hosts/winter/kernel.nix @@ -28,7 +28,7 @@ "intel_pstate=passive" "msr.allow_writes=on" ]; - kernelPackages = pkgs.lib.mkForce pkgs.linux-lava; + kernelPackages = pkgs.lib.mkForce (pkgs.linuxPackagesFor pkgs.linux-lava); }; zramSwap.enable = true; } diff --git a/overlays/linux.nix b/overlays/linux.nix index 202a587..5b48705 100644 --- a/overlays/linux.nix +++ b/overlays/linux.nix @@ -1,5 +1,5 @@ self: super: { - linux-lava = super.linuxPackagesFor ((super.linuxManualConfig ( + linux-lava = (super.linuxManualConfig ( let major = "5"; minor = "11"; @@ -71,5 +71,5 @@ self: super: { ia32Emulation = true; }; }; - })); + }); }