More variables

This commit is contained in:
Hadi 2024-05-17 10:28:02 +02:00
parent 0b32914be2
commit cc1efb2588
5 changed files with 18 additions and 38 deletions

View File

@ -187,8 +187,6 @@ git clone https://github.com/anotherhadi/nixy ~/.config/nixos
```
- Change the `variables.nix` file to match your configuration
- Remove the hardware module in flake.nix line 30
- Change the `nixos/configuration.nix` file to match your system
- Copy your `hardware-configuration.nix` file to the `nixos` folder
```sh

View File

@ -421,22 +421,6 @@
"type": "github"
}
},
"nixos-hardware": {
"locked": {
"lastModified": 1715148395,
"narHash": "sha256-lRxjTxY3103LGMjWdVqntKZHhlmMX12QUjeFrQMmGaE=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "a4e2b7909fc1bdf30c30ef21d388fde0b5cdde4a",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "master",
"repo": "nixos-hardware",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1696375444,
@ -606,7 +590,6 @@
"apple-fonts": "apple-fonts",
"home-manager": "home-manager",
"hyprland": "hyprland",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_3",
"nixvim": "nixvim",
"rose-pine-hyprcursor": "rose-pine-hyprcursor",

View File

@ -17,18 +17,16 @@
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
rose-pine-hyprcursor.url = "github:ndom91/rose-pine-hyprcursor";
};
outputs = inputs@{ nixpkgs, home-manager, sops-nix, hyprland, spicetify-nix
, nixos-hardware, ... }: {
outputs =
inputs@{ nixpkgs, home-manager, sops-nix, hyprland, spicetify-nix, ... }: {
nixosConfigurations = {
nixy = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
nixos-hardware.nixosModules.omen-16-n0005ne # REMOVE
./nixos/configuration.nix
./nixos/fonts.nix
./nixos/tuigreet.nix

View File

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs, config, ... }:
let
variable = import ../variables.nix;
imports = [ ./hardware-configuration.nix ];
@ -24,8 +24,6 @@ in {
networking.networkmanager.enable = true;
##############
networking.hostName = variable.hostName;
time.timeZone = variable.timeZone;
@ -50,13 +48,13 @@ in {
services = {
xserver = {
xkb.layout = "fr";
xkb.layout = variable.keyboardLayout;
xkb.variant = "";
};
blueman.enable = true;
gnome.gnome-keyring.enable = true;
};
console.keyMap = "fr";
console.keyMap = variable.keyboardLayout;
programs.zsh.enable = true;
users.defaultUserShell = pkgs.zsh;
@ -103,22 +101,23 @@ in {
auto-optimise-store = true;
experimental-features = [ "nix-command" "flakes" ];
};
gc = {
gc = if variable.enableAutoGarbageCollector then {
automatic = true;
persistent = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
} else
{ };
};
# Auto Update
# system.autoUpgrade = {
# enable = true;
# dates = "04:00";
# flake = "${config.users.users.${variable.username}.home}/.config/nixos";
# flags = [ "--update-input" "nixpkgs" "--commit-lock-file" ];
# allowReboot = false;
# };
system.autoUpgrade = if variable.enableAutoUpgrade then {
enable = true;
dates = "04:00";
flake = "${config.users.users.${variable.username}.home}/.config/nixos";
flags = [ "--update-input" "nixpkgs" "--commit-lock-file" ];
allowReboot = false;
} else
{ };
services.dbus.enable = true;

View File

@ -14,6 +14,8 @@
};
stateVersion = "23.11";
enableAutoUpgrade = false;
enableAutoGarbageCollector = false;
enableSops = true;
enableNextcloud = true;
enableNvidia = true;