Add more checks and fixed old files

This commit is contained in:
Filippo Berto 2022-12-13 12:33:58 +01:00
parent 994708ec16
commit f097e7186d
No known key found for this signature in database
GPG key ID: FE98AE5EC52B1056
7 changed files with 133 additions and 82 deletions

View file

@ -1,5 +1,4 @@
{ pkgs ? import <nixos> { inherit system; }, system ? builtins.currentSystem }: { pkgs ? import <nixos> { inherit system; }, system ? builtins.currentSystem }:
let let
self = with pkgs; { self = with pkgs; {
clipedit = callPackage ./clipedit { }; clipedit = callPackage ./clipedit { };
@ -10,4 +9,4 @@ let
vital-synth = callPackage ./vital-synth { }; vital-synth = callPackage ./vital-synth { };
}; };
in in
(self) self

158
flake.nix
View file

@ -16,9 +16,23 @@
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
# nixos-generators.url = "github:nix-community/nixos-generators"; # nixos-generators.url = "github:nix-community/nixos-generators";
nixos-hardware.url = "github:NixOS/nixos-hardware"; nixos-hardware.url = "github:NixOS/nixos-hardware";
nix-rice = { url = "github:bertof/nix-rice"; inputs = { nixpkgs.follows = "nixpkgs"; flake-utils.follows = "flake-utils"; }; }; nix-rice = {
pre-commit-hooks = { url = "github:cachix/pre-commit-hooks.nix"; inputs.nixpkgs.follows = "nixpkgs"; inputs.flake-utils.follows = "flake-utils"; }; url = "github:bertof/nix-rice";
tex2nix = { url = "github:Mic92/tex2nix"; inputs.nixpkgs.follows = "nixpkgs"; inputs.flake-utils.follows = "flake-utils"; }; inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
tex2nix = {
url = "github:Mic92/tex2nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
}; };
outputs = outputs =
@ -28,11 +42,12 @@
, home-manager , home-manager
, deploy-rs , deploy-rs
, flake-utils , flake-utils
# , nixos-generators , # , nixos-generators
, nixos-hardware nixos-hardware
, nix-rice , nix-rice
, pre-commit-hooks , pre-commit-hooks
, tex2nix , tex2nix
,
}: }:
let let
config = { config = {
@ -72,14 +87,21 @@
]; ];
basic = with flake-utils.lib; eachDefaultSystem (system: basic = with flake-utils.lib; eachDefaultSystem (system:
let pkgs = import nixpkgs-u { inherit system config overlays; }; in let
pkgs = import nixpkgs-u { inherit system config overlays; };
in
{ {
formatter = pkgs.nixpkgs-fmt; formatter = pkgs.nixpkgs-fmt;
checks = { checks = {
pre-commit-check = pre-commit-hooks.lib.${system}.run { pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = ./.; src = ./.;
hooks = { nixpkgs-fmt.enable = true; nix-linter.enable = true; }; hooks = {
deadnix.enable = true;
nixpkgs-fmt.enable = true;
nix-linter.enable = true;
statix.enable = true;
};
}; };
}; };
@ -101,16 +123,39 @@
package = pkgs.nixVersions.stable; package = pkgs.nixVersions.stable;
extraOptions = "experimental-features = nix-command flakes"; extraOptions = "experimental-features = nix-command flakes";
registry = { registry = {
stable = { from = { id = "stable"; type = "indirect"; }; flake = nixpkgs; }; stable = {
unstable = { from = { id = "unstable"; type = "indirect"; }; flake = nixpkgs-u; }; from = {
tex2nix = { from = { id = "tex2nix"; type = "indirect"; }; flake = tex2nix; }; id = "stable";
type = "indirect";
};
flake = nixpkgs;
};
unstable = {
from = {
id = "unstable";
type = "indirect";
};
flake = nixpkgs-u;
};
tex2nix = {
from = {
id = "tex2nix";
type = "indirect";
};
flake = tex2nix;
};
}; };
}; };
}) })
# Home manager configuration # Home manager configuration
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ home-manager = { useGlobalPkgs = true; useUserPackages = true; }; } {
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
};
}
./nixos_modules/bertof_user.nix ./nixos_modules/bertof_user.nix
./nixos_modules/automatic-garbage-collection.nix ./nixos_modules/automatic-garbage-collection.nix
@ -122,19 +167,21 @@
nixosConfigurations = { nixosConfigurations = {
thor = nixpkgs.lib.nixosSystem rec { thor = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux"; system = "x86_64-linux";
modules = commonModules ++ [ modules =
{ nixpkgs.config = config // { cudaSupport = true; }; } commonModules
./thor/hardware-configuration.nix ++ [
nixos-hardware.nixosModules.common-cpu-amd { nixpkgs.config = config // { cudaSupport = true; }; }
nixos-hardware.nixosModules.common-pc-ssd ./thor/hardware-configuration.nix
./thor/configuration.nix nixos-hardware.nixosModules.common-cpu-amd
nixos-hardware.nixosModules.common-pc-ssd
./thor/configuration.nix
./nixos_modules/pro_audio.nix ./nixos_modules/pro_audio.nix
./nixos_modules/sesar.nix ./nixos_modules/sesar.nix
./nixos_modules/pentablet.nix ./nixos_modules/pentablet.nix
{ home-manager.users.bertof = import ./thor/hm.nix; } { home-manager.users.bertof = import ./thor/hm.nix; }
]; ];
}; };
}; };
}; };
@ -159,17 +206,23 @@
rec { rec {
odin-nvidia = nixpkgs.lib.nixosSystem rec { odin-nvidia = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux"; system = "x86_64-linux";
modules = commonModules ++ odinCommonModules ++ [ modules =
{ nixpkgs.config = config // { cudaSupport = true; }; } commonModules
./odin/configuration-nvidia.nix ++ odinCommonModules
]; ++ [
{ nixpkgs.config = config // { cudaSupport = true; }; }
./odin/configuration-nvidia.nix
];
}; };
odin-intel = nixpkgs.lib.nixosSystem rec { odin-intel = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux"; system = "x86_64-linux";
modules = commonModules ++ odinCommonModules ++ [ modules =
./odin/configuration-intel.nix commonModules
]; ++ odinCommonModules
++ [
./odin/configuration-intel.nix
];
}; };
odin = odin-intel; odin = odin-intel;
@ -180,12 +233,14 @@
nixosConfigurations = rec { nixosConfigurations = rec {
freya = nixpkgs.lib.nixosSystem rec { freya = nixpkgs.lib.nixosSystem rec {
system = "aarch64-linux"; system = "aarch64-linux";
modules = commonModules ++ [ modules =
nixos-hardware.nixosModules.raspberry-pi."4" commonModules
./freya/hardware-configuration.nix ++ [
./freya/configuration.nix nixos-hardware.nixosModules.raspberry-pi."4"
{ home-manager.users.bertof = import ./freya/hm.nix; } ./freya/hardware-configuration.nix
]; ./freya/configuration.nix
{ home-manager.users.bertof = import ./freya/hm.nix; }
];
}; };
}; };
}; };
@ -194,13 +249,15 @@
nixosConfigurations = rec { nixosConfigurations = rec {
baldur = nixpkgs.lib.nixosSystem rec { baldur = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux"; system = "x86_64-linux";
modules = commonModules ++ [ modules =
# nixos-hardware.nixosModules.common-cpu-amd commonModules
# nixos-hardware.nixosModules.common-pc-ssd ++ [
./baldur/hardware-configuration.nix # nixos-hardware.nixosModules.common-cpu-amd
./baldur/configuration.nix # nixos-hardware.nixosModules.common-pc-ssd
{ home-manager.users.bertof = import ./baldur/hm.nix; } ./baldur/hardware-configuration.nix
]; ./baldur/configuration.nix
{ home-manager.users.bertof = import ./baldur/hm.nix; }
];
}; };
}; };
}; };
@ -209,17 +266,18 @@
nixosConfigurations = rec { nixosConfigurations = rec {
loki = nixpkgs.lib.nixosSystem rec { loki = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux"; system = "x86_64-linux";
modules = commonModules ++ [ modules =
nixos-hardware.nixosModules.common-cpu-intel commonModules
nixos-hardware.nixosModules.common-pc-ssd ++ [
./loki/hardware-configuration.nix nixos-hardware.nixosModules.common-cpu-intel
./loki/configuration.nix nixos-hardware.nixosModules.common-pc-ssd
{ home-manager.users.bertof = import ./loki/hm.nix; } ./loki/hardware-configuration.nix
]; ./loki/configuration.nix
{ home-manager.users.bertof = import ./loki/hm.nix; }
];
}; };
}; };
}; };
in in
builtins.foldl' nixpkgs.lib.recursiveUpdate { } [ builtins.foldl' nixpkgs.lib.recursiveUpdate { } [
basic basic

View file

@ -2,8 +2,7 @@
let let
strPalette = with pkgs.rice; strPalette = with pkgs.rice;
pkgs.lib.rice.palette.toRgbHex rec { pkgs.lib.rice.palette.toRgbHex rec {
foreground = colorPalette.primary.foreground; inherit (colorPalette.primary) background foreground;
background = colorPalette.primary.background;
color0 = colorPalette.normal.black; color0 = colorPalette.normal.black;
color1 = colorPalette.normal.red; color1 = colorPalette.normal.red;
color2 = colorPalette.normal.green; color2 = colorPalette.normal.green;

View file

@ -15,9 +15,9 @@ let
lib.concatStringsSep " " lib.concatStringsSep " "
[ [
"${pkgs.yad}/bin/yad --question --center --on-top --sticky --timeout=30 --timeout-indicator=bottom" "${pkgs.yad}/bin/yad --question --center --on-top --sticky --timeout=30 --timeout-indicator=bottom"
(if isNull title then "" else ''--title "${title}"'') (if title == null then "" else ''--title "${title}"'')
(if isNull image then "" else ''--image "${image}"'') (if image == null then "" else ''--image "${image}"'')
(if isNull text then "" else ''--text "${text}"'') (if text == null then "" else ''--text "${text}"'')
"&& ${cmd}" "&& ${cmd}"
]; ];
systemctl = "${pkgs.systemd}/bin/systemctl"; systemctl = "${pkgs.systemd}/bin/systemctl";
@ -34,13 +34,13 @@ let
normal = { normal = {
foreground = colorPalette.normal.white; foreground = colorPalette.normal.white;
background = color.setAlphaRgba alpha (colorPalette.normal.black); background = color.setAlphaRgba alpha colorPalette.normal.black;
underline = colorPalette.dark.blue; underline = colorPalette.dark.blue;
}; };
active = { active = {
foreground = colorPalette.bright.white; foreground = colorPalette.bright.white;
background = color.setAlphaRgba alpha (colorPalette.normal.black); background = color.setAlphaRgba alpha colorPalette.normal.black;
underline = colorPalette.normal.yellow; underline = colorPalette.normal.yellow;
}; };
@ -50,14 +50,10 @@ let
underline = colorPalette.bright.red; underline = colorPalette.bright.red;
}; };
alert = colorPalette.bright.red; inherit (colorPalette.normal) green red yellow;
inherit (color) transparent;
green = colorPalette.normal.green;
yellow = colorPalette.normal.yellow;
orange = colorPalette.bright.red; orange = colorPalette.bright.red;
red = colorPalette.normal.red; alert = orange;
transparent = color.transparent;
}; };
commonBar = { commonBar = {
@ -67,8 +63,9 @@ let
height = 20; height = 20;
radius = 6.0; radius = 6.0;
fixed-center = false; fixed-center = false;
background = colors.normal.background;
foreground = colors.normal.foreground; inherit (colors.normal) background foreground;
line-size = 2; line-size = 2;
line-color = colors.normal.underline; line-color = colors.normal.underline;
padding = 0; padding = 0;
@ -306,38 +303,38 @@ in
}; };
menu = [ menu = [
[ [
({ {
text = ""; text = "";
exec = confirm_command { exec = confirm_command {
cmd = logout; cmd = logout;
title = "Logout"; title = "Logout";
text = "Do you want to logout?"; text = "Do you want to logout?";
}; };
}) }
({ {
text = ""; text = "";
exec = confirm_command { exec = confirm_command {
cmd = "${systemctl} reboot"; cmd = "${systemctl} reboot";
title = "Reboot"; title = "Reboot";
text = "Do you want to reboot?"; text = "Do you want to reboot?";
}; };
}) }
({ {
text = ""; text = "";
exec = confirm_command { exec = confirm_command {
cmd = "${systemctl} hibernate"; cmd = "${systemctl} hibernate";
title = "Hibernate"; title = "Hibernate";
text = "Do you want to hibernate?"; text = "Do you want to hibernate?";
}; };
}) }
({ {
text = ""; text = "";
exec = confirm_command { exec = confirm_command {
cmd = "${shutdown} now"; cmd = "${shutdown} now";
title = "Shutdown"; title = "Shutdown";
text = "Do you want to shutdown?"; text = "Do you want to shutdown?";
}; };
}) }
] ]
]; ];
}; };

View file

@ -1,5 +1,4 @@
{ ... }: { {
networking.hosts = { networking.hosts = {
"54.176.11.243" = [ "vpn.mhackeroni.it" ]; "54.176.11.243" = [ "vpn.mhackeroni.it" ];
"10.100.0.50" = [ "10.100.0.50" = [

View file

@ -1,4 +1,3 @@
{ ... }:
let let
blocklist = builtins.fetchurl { blocklist = builtins.fetchurl {
sha256 = "sha256:16xcx2z8ziv2fbqhr4ajayxblcs4i1ckrwnf50iina9asgia18za"; sha256 = "sha256:16xcx2z8ziv2fbqhr4ajayxblcs4i1ckrwnf50iina9asgia18za";

View file

@ -9,7 +9,7 @@ let
ayu-mirage = with super.lib.rice; ayu-mirage = with super.lib.rice;
palette.tPalette color.hexToRgba (import ./themes/ayu-mirage.nix); palette.tPalette color.hexToRgba (import ./themes/ayu-mirage.nix);
in in
(rec { rec {
rice = { rice = {
colorPalette = with super.lib.rice; rec { colorPalette = with super.lib.rice; rec {
normal = palette.defaultPalette // { normal = palette.defaultPalette // {
@ -34,10 +34,10 @@ in
}; };
monospace = { monospace = {
name = "FiraCode Nerd Font Mono"; name = "FiraCode Nerd Font Mono";
package = (self.nerdfonts.override { fonts = [ "FiraCode" ]; }); package = self.nerdfonts.override { fonts = [ "FiraCode" ]; };
size = 10; size = 10;
}; };
}; };
opacity = 0.95; opacity = 0.95;
}; };
}) }