1
0
Fork 0

Services: use unstable version of Netdata

This commit is contained in:
Aires 2024-08-05 09:49:07 -04:00
parent 397dd6bed3
commit 5fb5e3387d
4 changed files with 37 additions and 2 deletions

View file

@ -295,6 +295,22 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-unstable": {
"locked": {
"lastModified": 1722630782,
"narHash": "sha256-hMyG9/WlUi0Ho9VkRrrez7SeNlDzLxalm9FwY7n/Noo=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "d04953086551086b44b6f3c6b7eeb26294f207da",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1722651103, "lastModified": 1722651103,
@ -346,7 +362,8 @@
"nix-flatpak": "nix-flatpak", "nix-flatpak": "nix-flatpak",
"nix-secrets": "nix-secrets", "nix-secrets": "nix-secrets",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_2",
"nixpkgs-unstable": "nixpkgs-unstable"
} }
}, },
"rust-overlay": { "rust-overlay": {

View file

@ -8,6 +8,7 @@
# You can find a list of channels at https://wiki.nixos.org/wiki/Nix_channels # You can find a list of channels at https://wiki.nixos.org/wiki/Nix_channels
# To follow a different channel, replace `nixos-unstable` with the channel name, e.g. `nixos-24.05`. # To follow a different channel, replace `nixos-unstable` with the channel name, e.g. `nixos-24.05`.
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
# Use Lix in place of Nix. # Use Lix in place of Nix.
# If you'd rather use regular Nix, remove `lix-module.nixosModules.default` from the `modules` section below. # If you'd rather use regular Nix, remove `lix-module.nixosModules.default` from the `modules` section below.
@ -48,6 +49,7 @@
nix-flatpak, nix-flatpak,
nixos-hardware, nixos-hardware,
nixpkgs, nixpkgs,
nixpkgs-unstable,
nix-secrets, nix-secrets,
... ...
}: }:
@ -90,6 +92,15 @@
Dimaga = nixpkgs.lib.nixosSystem { Dimaga = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
# Add unstable repo
specialArgs = {
pkgs-unstable = import nixpkgs-unstable {
system = "x86_64-linux";
config.allowUnfree = true;
};
};
modules = defaultModules ++ [ modules = defaultModules ++ [
nixos-hardware.nixosModules.common-cpu-intel nixos-hardware.nixosModules.common-cpu-intel
./hosts/Dimaga ./hosts/Dimaga

View file

@ -19,7 +19,10 @@ in
config = lib.mkMerge [ config = lib.mkMerge [
(lib.mkIf cfg.enable { (lib.mkIf cfg.enable {
aux.system = { aux.system = {
packages = with pkgs; [ nixd ]; packages = with pkgs; [
nixd
nix-prefetch-hash
];
ui.flatpak = { ui.flatpak = {
enable = true; enable = true;
packages = [ "com.vscodium.codium" ]; packages = [ "com.vscodium.codium" ];

View file

@ -1,5 +1,6 @@
{ {
pkgs, pkgs,
pkgs-unstable,
config, config,
lib, lib,
... ...
@ -39,6 +40,7 @@ in
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
services = { services = {
nginx.virtualHosts."${cfg.url}" = { nginx.virtualHosts."${cfg.url}" = {
useACMEHost = cfg.domain; useACMEHost = cfg.domain;
@ -62,6 +64,7 @@ in
netdata = { netdata = {
enable = true; enable = true;
package = pkgs-unstable.netdataCloud;
enableAnalyticsReporting = false; enableAnalyticsReporting = false;
configDir = { configDir = {
# Enable nvidia-smi: https://nixos.wiki/wiki/Netdata#nvidia-smi # Enable nvidia-smi: https://nixos.wiki/wiki/Netdata#nvidia-smi
@ -72,5 +75,6 @@ in
}; };
}; };
systemd.services.nginx.wants = [ config.systemd.services.netdata.name ]; systemd.services.nginx.wants = [ config.systemd.services.netdata.name ];
}; };
} }