mirror of
https://github.com/traxys/Nixfiles.git
synced 2026-02-13 10:50:20 +01:00
Mutualize minimal NixOS configuration too
This commit is contained in:
parent
fdc6508740
commit
4fece8d5d7
8 changed files with 78 additions and 52 deletions
|
|
@ -1,16 +1,15 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{lib, ...}:
|
||||
with lib;
|
||||
with builtins; {
|
||||
options = {
|
||||
extraInfo.email = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
type = types.str;
|
||||
description = "Email address";
|
||||
default = null;
|
||||
};
|
||||
|
||||
extraInfo.username = mkOption {
|
||||
type = types.str;
|
||||
description = "Username to deploy the configuration as";
|
||||
};
|
||||
|
||||
extraInfo.inputs = {
|
||||
|
|
|
|||
14
flake.nix
14
flake.nix
|
|
@ -77,6 +77,8 @@
|
|||
neovimTraxys = inputs.nvim-traxys.packages."${system}".nvim;
|
||||
roaming_proxy = inputs.roaming_proxy.defaultPackage."${system}";
|
||||
};
|
||||
|
||||
extraInfo = import ./extra_info.nix;
|
||||
in {
|
||||
templates = {
|
||||
rust = {
|
||||
|
|
@ -87,18 +89,26 @@
|
|||
packages.x86_64-linux = pkgList "x86_64-linux" nixpkgs.legacyPackages.x86_64-linux.callPackage;
|
||||
|
||||
hmModules = {
|
||||
minimal = import ./minimal {
|
||||
minimal = import ./minimal/hm.nix {
|
||||
inherit inputs;
|
||||
flake = self;
|
||||
};
|
||||
};
|
||||
|
||||
nixosModules = {
|
||||
minimal = import ./minimal/nixos.nix {
|
||||
inherit extraInfo;
|
||||
};
|
||||
};
|
||||
|
||||
overlays.x86_64-linux = final: prev: pkgList "x86_64-linux" prev.callPackage;
|
||||
|
||||
nixosConfigurations = {
|
||||
ZeNixLaptop = nixpkgs.lib.nixosSystem rec {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
./hostconfig/ZeNixComputa/extra_info.nix
|
||||
self.nixosModules.minimal
|
||||
({pkgs, ...}: {
|
||||
nixpkgs.overlays = [
|
||||
inputs.nur.overlay
|
||||
|
|
@ -121,6 +131,7 @@
|
|||
...
|
||||
}: {
|
||||
imports = [
|
||||
self.hmModules.minimal
|
||||
./home.nix
|
||||
./graphical.nix
|
||||
./extra_info.nix
|
||||
|
|
@ -128,7 +139,6 @@
|
|||
./wm
|
||||
./rustdev.nix
|
||||
./git
|
||||
self.hmModules.minimal
|
||||
];
|
||||
};
|
||||
home-manager.extraSpecialArgs = {
|
||||
|
|
|
|||
3
hostconfig/ZeNixComputa/extra_info.nix
Normal file
3
hostconfig/ZeNixComputa/extra_info.nix
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
extraInfo.username = "traxys";
|
||||
}
|
||||
|
|
@ -145,7 +145,5 @@
|
|||
home.file = {
|
||||
".zprofile".source = ./zprofile;
|
||||
};
|
||||
|
||||
home.stateVersion = "21.11";
|
||||
};
|
||||
}
|
||||
56
minimal/nixos.nix
Normal file
56
minimal/nixos.nix
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
{extraInfo}: {
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [extraInfo];
|
||||
|
||||
users.users."${config.extraInfo.username}" = {
|
||||
isNormalUser = true;
|
||||
home = "/home/${config.extraInfo.username}";
|
||||
shell = pkgs.zsh;
|
||||
};
|
||||
|
||||
programs.zsh.enable = true;
|
||||
|
||||
i18n.defaultLocale = "en_GB.UTF-8";
|
||||
console = {
|
||||
font = "Lat2-Terminus16";
|
||||
keyMap = "dvorak-programmer";
|
||||
};
|
||||
|
||||
environment.pathsToLink = ["/share/zsh"];
|
||||
fonts.enableDefaultFonts = true;
|
||||
fonts = {
|
||||
fonts = with pkgs; [
|
||||
(nerdfonts.override {fonts = ["Hack"];})
|
||||
dejavu_fonts
|
||||
];
|
||||
fontconfig = {
|
||||
defaultFonts = {
|
||||
serif = ["DejaVu"];
|
||||
sansSerif = ["DejaVu Sans"];
|
||||
monospace = ["Hack"];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nix = {
|
||||
package = pkgs.nixUnstable;
|
||||
|
||||
extraOptions = ''
|
||||
experimental-features = nix-command flakes
|
||||
'';
|
||||
|
||||
settings = {
|
||||
auto-optimise-store = true;
|
||||
substituters = ["https://nix-gaming.cachix.org"];
|
||||
trusted-public-keys = ["nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="];
|
||||
};
|
||||
};
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 14d";
|
||||
};
|
||||
}
|
||||
|
|
@ -20,14 +20,6 @@
|
|||
# replicates the default behaviour.
|
||||
networking.useDHCP = false;
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n.defaultLocale = "en_GB.UTF-8";
|
||||
console = {
|
||||
font = "Lat2-Terminus16";
|
||||
keyMap = "dvorak-programmer";
|
||||
};
|
||||
|
||||
environment.pathsToLink = ["/share/zsh"];
|
||||
security.rtkit.enable = true;
|
||||
services = {
|
||||
tzupdate.enable = true;
|
||||
|
|
@ -51,21 +43,6 @@
|
|||
programs.nix-ld.enable = true;
|
||||
hardware.opentabletdriver.enable = true;
|
||||
|
||||
fonts.enableDefaultFonts = true;
|
||||
fonts = {
|
||||
fonts = with pkgs; [
|
||||
(nerdfonts.override {fonts = ["Hack"];})
|
||||
dejavu_fonts
|
||||
];
|
||||
fontconfig = {
|
||||
defaultFonts = {
|
||||
serif = ["DejaVu"];
|
||||
sansSerif = ["DejaVu Sans"];
|
||||
monospace = ["Hack"];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
boot.kernelPackages = pkgs.linuxPackages;
|
||||
/*
|
||||
nixpkgs.config.allowBroken = true;
|
||||
|
|
@ -128,13 +105,6 @@
|
|||
];
|
||||
};
|
||||
|
||||
nix.settings.auto-optimise-store = true;
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 14d"; # Ajuste comme tu veux, tu peux utiliser +5 pour garder les 5 dernières, etc.
|
||||
};
|
||||
|
||||
# This value determines the NixOS release from which the default
|
||||
# settings for stateful data, like file locations and database versions
|
||||
# on your system were taken. It‘s perfectly fine and recommended to leave
|
||||
|
|
|
|||
|
|
@ -58,8 +58,6 @@
|
|||
users = {
|
||||
traxys = {
|
||||
uid = 1000;
|
||||
isNormalUser = true;
|
||||
home = "/home/traxys";
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
"networkmanager"
|
||||
|
|
@ -72,7 +70,6 @@
|
|||
"scanner"
|
||||
"lp"
|
||||
];
|
||||
shell = pkgs.zsh;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -17,13 +17,6 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
nix = {
|
||||
package = pkgs.nixUnstable;
|
||||
extraOptions = ''
|
||||
experimental-features = nix-command flakes
|
||||
'';
|
||||
};
|
||||
|
||||
# boot.extraModulePackages = [ ashmem binder ];
|
||||
# boot.kernelModules = [ "ashmem_linux" "binder_linux" ];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue