Add checks
This commit is contained in:
parent
e9dedabcb8
commit
fb52571c41
11
firefox.nix
11
firefox.nix
|
@ -1,11 +1,6 @@
|
||||||
{ config, lib, pkgs, osConfig, ... }:
|
{ config, lib, pkgs, ... }@args:
|
||||||
let
|
let
|
||||||
inherit (osConfig) hardware;
|
osConfig = args.osConfig or { };
|
||||||
|
|
||||||
graphical =
|
|
||||||
if lib.versionAtLeast osConfig.system.stateVersion "24.11"
|
|
||||||
then hardware.graphics.enable
|
|
||||||
else hardware.opengl.enable;
|
|
||||||
|
|
||||||
firefox-csshacks = pkgs.fetchFromGitHub {
|
firefox-csshacks = pkgs.fetchFromGitHub {
|
||||||
owner = "MrOtherGuy";
|
owner = "MrOtherGuy";
|
||||||
|
@ -14,7 +9,7 @@ let
|
||||||
sparseCheckout = [ "!/*" "/chrome" "/content" ];
|
sparseCheckout = [ "!/*" "/chrome" "/content" ];
|
||||||
hash = "sha256-rk0jC5AMw41xt5yItY7CAxuYAFhoe5Jy2tvwgh59cPI=";
|
hash = "sha256-rk0jC5AMw41xt5yItY7CAxuYAFhoe5Jy2tvwgh59cPI=";
|
||||||
};
|
};
|
||||||
in lib.mkIf graphical {
|
in lib.mkIf (osConfig.hardware.graphics.enable or false) {
|
||||||
programs.firefox = {
|
programs.firefox = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.firefox;
|
package = pkgs.firefox;
|
||||||
|
|
36
flake.nix
36
flake.nix
|
@ -22,8 +22,42 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, ... }@inputs: {
|
outputs = { self, nixpkgs, home-manager, ... }@inputs:
|
||||||
|
let
|
||||||
|
inherit (nixpkgs) lib;
|
||||||
|
in {
|
||||||
nixosModules.default = import ./module.nix inputs;
|
nixosModules.default = import ./module.nix inputs;
|
||||||
homeConfigurations.default = import ./home.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; };
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
12
home.nix
12
home.nix
|
@ -1,11 +1,6 @@
|
||||||
inputs: { config, lib, pkgs, osConfig, ... }:
|
inputs: { config, lib, pkgs, ... }@args:
|
||||||
let
|
let
|
||||||
inherit (osConfig) hardware;
|
osConfig = args.osConfig or { };
|
||||||
|
|
||||||
graphical =
|
|
||||||
if lib.versionAtLeast osConfig.system.stateVersion "24.11"
|
|
||||||
then hardware.graphics.enable
|
|
||||||
else hardware.opengl.enable;
|
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
inputs.nur.hmModules.nur
|
inputs.nur.hmModules.nur
|
||||||
|
@ -226,7 +221,8 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.jq.enable = true;
|
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.ripgrep.enable = true;
|
||||||
|
|
||||||
programs.ssh = {
|
programs.ssh = {
|
||||||
|
|
|
@ -1,11 +1,6 @@
|
||||||
inputs: user: { config, lib, pkgs, ... }:
|
inputs: user: { config, lib, pkgs, ... }:
|
||||||
let
|
let
|
||||||
inherit (config) hardware;
|
graphical = config.hardware.graphics.enable;
|
||||||
|
|
||||||
graphical =
|
|
||||||
if lib.versionAtLeast config.system.stateVersion "24.11"
|
|
||||||
then hardware.graphics.enable
|
|
||||||
else hardware.opengl.enable;
|
|
||||||
in {
|
in {
|
||||||
imports = [ inputs.home-manager.nixosModules.home-manager ];
|
imports = [ inputs.home-manager.nixosModules.home-manager ];
|
||||||
|
|
||||||
|
|
22
wayland.nix
22
wayland.nix
|
@ -1,11 +1,6 @@
|
||||||
{ config, lib, pkgs, osConfig, ... }:
|
{ config, lib, pkgs, ... }@args:
|
||||||
let
|
let
|
||||||
inherit (osConfig) hardware location;
|
osConfig = args.osConfig or { };
|
||||||
|
|
||||||
graphical =
|
|
||||||
if lib.versionAtLeast osConfig.system.stateVersion "24.11"
|
|
||||||
then hardware.graphics.enable
|
|
||||||
else hardware.opengl.enable;
|
|
||||||
|
|
||||||
cmd = {
|
cmd = {
|
||||||
brightnessctl = "${pkgs.brightnessctl}/bin/brightnessctl";
|
brightnessctl = "${pkgs.brightnessctl}/bin/brightnessctl";
|
||||||
|
@ -26,7 +21,7 @@ let
|
||||||
wpctl = "${osConfig.services.pipewire.wireplumber.package}/bin/wpctl";
|
wpctl = "${osConfig.services.pipewire.wireplumber.package}/bin/wpctl";
|
||||||
xdg-open = "${pkgs.xdg-utils}/bin/xdg-open";
|
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; [
|
home.packages = with pkgs; [
|
||||||
# Image processing
|
# Image processing
|
||||||
oxipng
|
oxipng
|
||||||
|
@ -321,17 +316,16 @@ in lib.mkIf graphical {
|
||||||
|
|
||||||
programs.yt-dlp.enable = true;
|
programs.yt-dlp.enable = true;
|
||||||
|
|
||||||
services.gammastep = {
|
services.gammastep = lib.optionalAttrs (osConfig ? location) (
|
||||||
|
let inherit (osConfig) location; in {
|
||||||
inherit (location) provider;
|
inherit (location) provider;
|
||||||
|
|
||||||
enable = true;
|
enable = true;
|
||||||
latitude = location.latitude or null;
|
|
||||||
longitude = location.longitude or null;
|
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
general.adjustment-method = "wayland";
|
general.adjustment-method = "wayland";
|
||||||
};
|
};
|
||||||
};
|
} // lib.optionalAttrs (location.provider == "manual") {
|
||||||
|
inherit (location) latitude longitude;
|
||||||
|
});
|
||||||
|
|
||||||
services.hypridle = {
|
services.hypridle = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
Reference in a new issue