Add checks

This commit is contained in:
Mikael 2024-08-07 14:43:20 +02:00
parent e9dedabcb8
commit fb52571c41
Signed by: mikael
SSH key fingerprint: SHA256:21QyD2Meiot7jOUVitIR5YkGB/XuXdCvLW1hE6dsri0
5 changed files with 51 additions and 37 deletions

View file

@ -1,11 +1,6 @@
{ config, lib, pkgs, osConfig, ... }:
{ config, lib, pkgs, ... }@args:
let
inherit (osConfig) hardware;
graphical =
if lib.versionAtLeast osConfig.system.stateVersion "24.11"
then hardware.graphics.enable
else hardware.opengl.enable;
osConfig = args.osConfig or { };
firefox-csshacks = pkgs.fetchFromGitHub {
owner = "MrOtherGuy";
@ -14,7 +9,7 @@ let
sparseCheckout = [ "!/*" "/chrome" "/content" ];
hash = "sha256-rk0jC5AMw41xt5yItY7CAxuYAFhoe5Jy2tvwgh59cPI=";
};
in lib.mkIf graphical {
in lib.mkIf (osConfig.hardware.graphics.enable or false) {
programs.firefox = {
enable = true;
package = pkgs.firefox;

View file

@ -22,8 +22,42 @@
};
};
outputs = { self, ... }@inputs: {
outputs = { self, nixpkgs, home-manager, ... }@inputs:
let
inherit (nixpkgs) lib;
in {
nixosModules.default = import ./module.nix inputs;
homeConfigurations.default = import ./home.nix inputs;
checks = lib.genAttrs lib.systems.flakeExposed (system: {
home = (home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.${system};
modules = [
self.homeConfigurations.default {
home.username = "nil";
home.homeDirectory = "/home/nil";
}
];
}).activationPackage;
} // lib.optionalAttrs (lib.hasSuffix "-linux" system) {
nixos = (nixpkgs.lib.nixosSystem {
inherit system;
modules = [
(self.nixosModules.default "nil") {
boot.loader.grub.enable = false;
fileSystems."/".device = "nodev";
hardware.graphics.enable = true;
location = {
provider = "manual";
latitude = 90.0;
longitude = 0.0;
};
system.stateVersion = lib.versions.majorMinor lib.version;
}
];
}).config.system.build.toplevel;
});
hydraJobs.checks = { inherit (self.checks) x86_64-linux; };
};
}

View file

@ -1,11 +1,6 @@
inputs: { config, lib, pkgs, osConfig, ... }:
inputs: { config, lib, pkgs, ... }@args:
let
inherit (osConfig) hardware;
graphical =
if lib.versionAtLeast osConfig.system.stateVersion "24.11"
then hardware.graphics.enable
else hardware.opengl.enable;
osConfig = args.osConfig or { };
in {
imports = [
inputs.nur.hmModules.nur
@ -226,7 +221,8 @@ in {
};
programs.jq.enable = true;
programs.man.generateCaches = osConfig.documentation.man.generateCaches;
programs.man.generateCaches =
osConfig.documentation.man.generateCaches or false;
programs.ripgrep.enable = true;
programs.ssh = {

View file

@ -1,11 +1,6 @@
inputs: user: { config, lib, pkgs, ... }:
let
inherit (config) hardware;
graphical =
if lib.versionAtLeast config.system.stateVersion "24.11"
then hardware.graphics.enable
else hardware.opengl.enable;
graphical = config.hardware.graphics.enable;
in {
imports = [ inputs.home-manager.nixosModules.home-manager ];

View file

@ -1,11 +1,6 @@
{ config, lib, pkgs, osConfig, ... }:
{ config, lib, pkgs, ... }@args:
let
inherit (osConfig) hardware location;
graphical =
if lib.versionAtLeast osConfig.system.stateVersion "24.11"
then hardware.graphics.enable
else hardware.opengl.enable;
osConfig = args.osConfig or { };
cmd = {
brightnessctl = "${pkgs.brightnessctl}/bin/brightnessctl";
@ -26,7 +21,7 @@ let
wpctl = "${osConfig.services.pipewire.wireplumber.package}/bin/wpctl";
xdg-open = "${pkgs.xdg-utils}/bin/xdg-open";
};
in lib.mkIf graphical {
in lib.mkIf (osConfig.hardware.graphics.enable or false) {
home.packages = with pkgs; [
# Image processing
oxipng
@ -321,17 +316,16 @@ in lib.mkIf graphical {
programs.yt-dlp.enable = true;
services.gammastep = {
services.gammastep = lib.optionalAttrs (osConfig ? location) (
let inherit (osConfig) location; in {
inherit (location) provider;
enable = true;
latitude = location.latitude or null;
longitude = location.longitude or null;
settings = {
general.adjustment-method = "wayland";
};
};
} // lib.optionalAttrs (location.provider == "manual") {
inherit (location) latitude longitude;
});
services.hypridle = {
enable = true;