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 - 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 - Copy your `hardware-configuration.nix` file to the `nixos` folder
```sh ```sh

View File

@ -421,22 +421,6 @@
"type": "github" "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": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1696375444, "lastModified": 1696375444,
@ -606,7 +590,6 @@
"apple-fonts": "apple-fonts", "apple-fonts": "apple-fonts",
"home-manager": "home-manager", "home-manager": "home-manager",
"hyprland": "hyprland", "hyprland": "hyprland",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_3", "nixpkgs": "nixpkgs_3",
"nixvim": "nixvim", "nixvim": "nixvim",
"rose-pine-hyprcursor": "rose-pine-hyprcursor", "rose-pine-hyprcursor": "rose-pine-hyprcursor",

View File

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

View File

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

View File

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