Merge branch 'cosmic'

This commit is contained in:
Wroclaw 2024-08-08 16:48:29 +02:00
commit 7e38202a05
6 changed files with 92 additions and 0 deletions

17
hosts/vm-cosmic.nix Normal file
View file

@ -0,0 +1,17 @@
{ inputs, ... }:
{
imports = [
./vm-base.nix
../nix-os/desktopManagers/cosmic.nix
../nix-os/displayManagers/cosmic-greeter.nix
];
config = {
nixpkgs.overlays = [(import ../pkgs/overlays/cosmic-packages.nix { inherit inputs; })];
nix.settings = {
substituters = [ "https://cosmic.cachix.org/" ];
trusted-public-keys = [ "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" ];
};
};
}

View file

@ -15,5 +15,10 @@ let self = {
url = "https://github.com/NixOS/nixpkgs/archive/${lock.nixpkgs.revision}.tar.gz"; url = "https://github.com/NixOS/nixpkgs/archive/${lock.nixpkgs.revision}.tar.gz";
sha256 = "${lock.nixpkgs.sha256}"; sha256 = "${lock.nixpkgs.sha256}";
}; };
cosmic-modules = builtins.fetchTarball {
name = "cosmic-modules";
url = "https://github.com/lilyinstarlight/nixos-cosmic/archive/${lock.cosmic-modules.revision}.tar.gz";
sha256 = "${lock.cosmic-modules.sha256}";
};
}; };
in self in self

View file

@ -7,4 +7,8 @@
revision = "883180e6550c1723395a3a342f830bfc5c371f6b"; revision = "883180e6550c1723395a3a342f830bfc5c371f6b";
sha256 = "01axrf25mahbxmp6vgfgx09dflbyaavr5liynkp6rpm4lkacr27f"; sha256 = "01axrf25mahbxmp6vgfgx09dflbyaavr5liynkp6rpm4lkacr27f";
}; };
cosmic-modules = {
revision = "d8b2b9aee034c10ca67848653171f576f87434a8";
sha256 = "03i8smxgx2fdb9kkys81dihb5yja3nk9wjs1rx5h7f3b5kii1fd7";
};
} }

View file

@ -0,0 +1,10 @@
{ inputs, lib, pkgs, ... }:
{
imports = [
"${inputs.cosmic-modules}/nixos/cosmic/module.nix"
];
config = {
services.desktopManager.cosmic.enable = true;
};
}

View file

@ -0,0 +1,10 @@
{ inputs, lib, pkgs, ... }:
{
imports = [
"${inputs.cosmic-modules}/nixos/cosmic-greeter/module.nix"
];
config = {
services.displayManager.cosmic-greeter.enable = true;
};
}

View file

@ -0,0 +1,46 @@
{ inputs ? import ../../inputs.nix {}}:
self: super:
let
nixos-cosmic = inputs.cosmic-modules;
cosmicPkgsMainDir = builtins.readDir "${nixos-cosmic}/pkgs";
cosmicPkgsDirs = builtins.filter (v: cosmicPkgsMainDir."${v}" == "directory") (builtins.attrNames cosmicPkgsMainDir);
# FIXME: use unstable nixpkgs when rust 1.80 will be available in unstable
stagingNixpkgsSrc = builtins.fetchTarball {
name = "nixpkgs";
url = "https://github.com/NixOS/nixpkgs/archive/b79cec4237cd0f655562890bf927466c68b48d68.tar.gz";
sha256 = "1mswisq9iwffg2d6rfxvr27mvi4w853d9rn222s2g76445d0iqh8";
};
# Take rustPackages from staging nixpkgs
stagingNixpkgs = import stagingNixpkgsSrc {
localSystem = self.stdenv.buildPlatform;
config = self.config;
} // (if self.stdenv.buildPlatform == self.stdenv.hostPlatform then {} else {
crossSystem = self.stdenv.hostPlatform;
});
futureRustPackages = stagingNixpkgs.rustPackages;
# Create nixpkgs with future rust
nixpkgsWithFutureRust = self.extend (futureSelf: futureSuper: {
rustPackages = futureRustPackages;
});
# Create cosmicPkgs that contains cosmic packages built from nixpkgs with future rust
cosmicOverlay = cosmicSelf: cosmicSuper: builtins.listToAttrs (
builtins.map (v: {name = v; value = nixpkgsWithFutureRust.callPackage "${nixos-cosmic}/pkgs/${v}/package.nix" {};}) cosmicPkgsDirs
);
cosmicNixpkgs = import inputs.nixpkgs {
localSystem = self.stdenv.buildPlatform;
config = self.config;
overlays = [ cosmicOverlay ];
} // (if self.stdenv.buildPlatform == self.stdenv.hostPlatform then {} else {
crossSystem = self.stdenv.hostPlatform;
});
in
builtins.listToAttrs (
builtins.map (v: {name = v; value = cosmicNixpkgs.${v};}) cosmicPkgsDirs
)