seperate hosts in each file

This commit is contained in:
Ranomier 2024-09-29 12:05:41 +02:00
parent 2597fc7fb8
commit 6e143facef
7 changed files with 168 additions and 144 deletions

23
default.nix Normal file
View file

@ -0,0 +1,23 @@
# This file defines overlays
{inputs, ...}: {
# This one brings our custom packages from the 'pkgs' directory
additions = final: _prev: import ../pkgs final.pkgs;
# This one contains whatever you want to overlay
# You can change versions, add patches, set compilation flags, anything really.
# https://nixos.wiki/wiki/Overlays
modifications = final: prev: {
# example = prev.example.overrideAttrs (oldAttrs: rec {
# ...
# });
};
# When applied, the unstable nixpkgs set (declared in the flake inputs) will
# be accessible through 'pkgs.unstable'
unstable-packages = final: _prev: {
unstable = import inputs.nixpkgs-unstable {
system = final.system;
config.allowUnfree = true;
};
};
}

View file

@ -7,11 +7,11 @@
]
},
"locked": {
"lastModified": 1726592409,
"narHash": "sha256-2Y6CDvD/BD43WLS77PHu6dUHbdUfFhuzkY8oJAecD/U=",
"lastModified": 1726989464,
"narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "2ab00f89dd3ecf8012f5090e6d7ca1a7ea30f594",
"rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176",
"type": "github"
},
"original": {
@ -38,25 +38,27 @@
},
"nixos-hardware": {
"locked": {
"lastModified": 1726489388,
"narHash": "sha256-JBHtN+n1HzKawpnOQAz6jdgvrtYV9c/kyzgoIdguQGo=",
"lastModified": 1727437159,
"narHash": "sha256-v4qLwEw5OmprgQZTT7KZMNU7JjXJzRypw8+Cw6++fWk=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "dc8b0296f68f72f3fe77469c549a6f098555c2e9",
"rev": "d830ad47cc992b4a46b342bbc79694cbd0e980b2",
"type": "github"
},
"original": {
"id": "nixos-hardware",
"type": "indirect"
"owner": "NixOS",
"ref": "master",
"repo": "nixos-hardware",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1726447378,
"narHash": "sha256-2yV8nmYE1p9lfmLHhOCbYwQC/W8WYfGQABoGzJOb1JQ=",
"lastModified": 1727264057,
"narHash": "sha256-KQPI8CTTnB9CrJ7LrmLC4VWbKZfljEPBXOFGZFRpxao=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "086b448a5d54fd117f4dc2dee55c9f0ff461bdc1",
"rev": "759537f06e6999e141588ff1c9be7f3a5c060106",
"type": "github"
},
"original": {
@ -68,11 +70,11 @@
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1726463316,
"narHash": "sha256-gI9kkaH0ZjakJOKrdjaI/VbaMEo9qBbSUl93DnU7f4c=",
"lastModified": 1727348695,
"narHash": "sha256-J+PeFKSDV+pHL7ukkfpVzCOO7mBSrrpJ3svwBFABbhI=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "99dc8785f6a0adac95f5e2ab05cc2e1bf666d172",
"rev": "1925c603f17fc89f4c8f6bf6f631a802ad85d784",
"type": "github"
},
"original": {

123
flake.nix
View file

@ -11,7 +11,7 @@
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
# ready made hardware configurations. e.G.: Power saving
#nixos-hardware.url = "github:NixOS/nixos-hardware/master";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
# NixOS unstable channel
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
@ -30,77 +30,58 @@
#######
outputs =
#######
{ self, nixpkgs, nixos-hardware, nixpkgs-unstable, nix-flatpak, home-manager, ... }: let
overlays = {
unstable-packages = final: prev: {
unstable = import nixpkgs-unstable {
system = "x86_64-linux";
config.allowUnfree = true;
{ self, nixpkgs, nixos-hardware, nixpkgs-unstable, nix-flatpak, home-manager, ... } @ inputs:
let
# Supported systems for your flake packages, shell, etc.
systems = [
"aarch64-linux"
"x86_64-linux"
];
# This is a function that generates an attribute by calling a function you
# pass to it, with each system as an argument
forAllSystems = nixpkgs.lib.genAttrs systems;
in {
# Your custom packages
# Accessible through 'nix build', 'nix shell', etc
#packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
# Formatter for your nix files, available through 'nix fmt'
# Other options beside 'alejandra' include 'nixpkgs-fmt'
#formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
# Your custom packages and modifications, exported as overlays
overlays = import ./overlays {inherit inputs;};
# Reusable nixos modules you might want to export
# These are usually stuff you would upstream into nixpkgs
nixosModules = import ./modules/nixos;
# Reusable home-manager modules you might want to export
# These are usually stuff you would upstream into home-manager
homeManagerModules = import ./modules/home-manager;
# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = {
# FIXME replace with your hostname
crocoite = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs;};
modules = [
# > Our main nixos configuration file <
./hosts/crocoite.nix
];
};
};
};
in {
# NOTE: 'nixos' is the default hostname set by the installer
nixosConfigurations.crocoite = nixpkgs.lib.nixosSystem {
modules = [
( let
pkgs2 = nixpkgs.legacyPackages."x86_64-linux";
in
{
nixpkgs.overlays = [ overlays.unstable-packages ];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
# https://lix.systems/ Lix is a modern, delicious implementation of the Nix package manager,
# focused on correctness, usability, and growth
# and committed to doing right by its community.
nix.package = pkgs2.lix;
# 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. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.05"; # Did you read the comment?
})
nix-flatpak.nixosModules.nix-flatpak
./hardware-configuration.nix
#nixos-hardware.nixosModules.lenovo-thinkpad-t14-amd-gen1
./modules/basic_system_config.nix
./modules/networking.nix
./modules/boot_theming.nix
./modules/specific_hardware/scan_and_print.nix
./modules/specific_hardware/fwupd.nix
./modules/specific_hardware/bluetooth.nix
./modules/sec_auth/firejail.nix
./modules/sec_auth/login-manager.nix
./modules/sec_auth/users_and_permissions.nix
./modules/sec_auth/ssh.nix
./modules/software/software.nix
./modules/software/game.nix
./modules/software/audio_video.nix
./modules/software/obs-studio.nix
./modules/wm_and_de/hyprland.nix
./modules/pkg_mgrmnt/flatpak.nix
./modules/pkg_mgrmnt/podman.nix
./modules/pkg_mgrmnt/store_pkg_file.nix
./modules/software/nix-helper/index.nix
./modules/software/nix-helper/doc.nix
./modules/software/nix-helper/nix-ld.nix
./modules/software/browser/firefox.nix
./modules/software/browser/brave.nix
];
## Standalone home-manager configuration entrypoint
## Available through 'home-manager --flake .#your-username@your-hostname'
#homeConfigurations = {
# # FIXME replace with your username@hostname
# "your-username@your-hostname" = home-manager.lib.homeManagerConfiguration {
# pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
# extraSpecialArgs = {inherit inputs;};
# modules = [
# # > Our main home-manager configuration file <
# ./home-manager/home.nix
# ];
# };
#};
};
};
}

View file

@ -1,64 +1,61 @@
{ ... }: {
{ pkgs, overlays, inputs, ... }: {
#MANPAGER='nvim +Man!'
# Allow unfree packages
#unstable.config.allowUnfree = true;
{ nixpkgs.config.allowUnfree = true; }
# 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. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.05"; # Did you read the comment?
( let
pkgs2 = nixpkgs.legacyPackages."x86_64-linux";
in
{
nixpkgs.overlays = [ overlays.unstable-packages ];
# Allow unfree packages
#unstable.config.allowUnfree = true;
nixpkgs.config.allowUnfree = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
#nixpkgs.overlays = [ overlays.unstable-packages ];
# https://lix.systems/ Lix is a modern, delicious implementation of the Nix package manager,
# focused on correctness, usability, and growth
# and committed to doing right by its community.
nix.package = pkgs2.lix;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
# 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. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.05"; # Did you read the comment?
})
nix-flatpak.nixosModules.nix-flatpak
# https://lix.systems/ Lix is a modern, delicious implementation of the Nix package manager,
# focused on correctness, usability, and growth
# and committed to doing right by its community.
nix.package = pkgs.lix;
imports = [
inputs.nix-flatpak.nixosModules.nix-flatpak
./hardware-configuration.nix
#nixos-hardware.nixosModules.lenovo-thinkpad-t14-amd-gen1
#nixos-hardware.nixosModules.lenovo-thinkpad-t14-amd-gen1
../hardware-configuration.nix
./modules/basic_system_config.nix
./modules/networking.nix
./modules/boot_theming.nix
../modules/basic_system_config.nix
../modules/networking.nix
../modules/boot_theming.nix
./modules/specific_hardware/scan_and_print.nix
./modules/specific_hardware/fwupd.nix
./modules/specific_hardware/bluetooth.nix
../modules/specific_hardware/scan_and_print.nix
../modules/specific_hardware/fwupd.nix
../modules/specific_hardware/bluetooth.nix
./modules/sec_auth/firejail.nix
./modules/sec_auth/login-manager.nix
./modules/sec_auth/users_and_permissions.nix
./modules/sec_auth/ssh.nix
../modules/sec_auth/firejail.nix
../modules/sec_auth/login-manager.nix
../modules/sec_auth/users_and_permissions.nix
../modules/sec_auth/ssh.nix
./modules/software/software.nix
./modules/software/game.nix
./modules/software/audio_video.nix
./modules/software/obs-studio.nix
../modules/software/software.nix
../modules/software/game.nix
../modules/software/audio_video.nix
../modules/software/obs-studio.nix
./modules/wm_and_de/hyprland.nix
../modules/wm_and_de/hyprland.nix
./modules/pkg_mgrmnt/flatpak.nix
./modules/pkg_mgrmnt/podman.nix
./modules/pkg_mgrmnt/store_pkg_file.nix
../modules/pkg_mgrmnt/flatpak.nix
../modules/pkg_mgrmnt/podman.nix
../modules/pkg_mgrmnt/store_pkg_file.nix
./modules/software/nix-helper/index.nix
./modules/software/nix-helper/doc.nix
./modules/software/nix-helper/nix-ld.nix
../modules/software/nix-helper/index.nix
../modules/software/nix-helper/doc.nix
../modules/software/nix-helper/nix-ld.nix
./modules/software/browser/firefox.nix
./modules/software/browser/brave.nix
../modules/software/browser/firefox.nix
../modules/software/browser/brave.nix
];
}

View file

@ -1,6 +1,4 @@
# TODO refine firejail it seems that / is not shielded enough and app armor does not work
{ pkgs, ... }:
{
programs.firejail = {
@ -16,8 +14,8 @@
"--env=GTK_THEME=Adwaita:dark"
# Enable system notifications
"--dbus-user.talk=org.freedesktop.Notifications"
# For screen sharing
"--dbus-user.talk=org.freedesktop.portal.*"
# For screen sharing
"--dbus-user.talk=org.freedesktop.portal.*"
];
};

View file

@ -1,8 +1,6 @@
{ pkgs, ... }: {
# Allow unfree packages
#unstable.config.allowUnfree = true;
nixpkgs.config.allowUnfree = true;
{ pkgs, inputs, config, ... }: let
unstable_list = [ inputs.nixpkgs-unstable.legacyPackages."x86_64-linux".neovim ];
in {
# also opens the TCP and UDP port from 1714 to 1764
programs.kdeconnect.enable = true;
@ -39,7 +37,7 @@
lm_sensors
# neovim
unstable.neovim
# unstable.neovim
git
gnumake
gcc
@ -74,7 +72,9 @@
keepassxc
#minecraft
element-desktop
];
] ++ unstable_list;
fonts.packages = with pkgs; [
noto-fonts
noto-fonts-cjk

23
overlays/default.nix Normal file
View file

@ -0,0 +1,23 @@
# This file defines overlays
{inputs, ...}: {
# This one brings our custom packages from the 'pkgs' directory
additions = final: _prev: import ../pkgs final.pkgs;
# This one contains whatever you want to overlay
# You can change versions, add patches, set compilation flags, anything really.
# https://nixos.wiki/wiki/Overlays
modifications = final: prev: {
# example = prev.example.overrideAttrs (oldAttrs: rec {
# ...
# });
};
# When applied, the unstable nixpkgs set (declared in the flake inputs) will
# be accessible through 'pkgs.unstable'
unstable-packages = final: _prev: {
unstable = import inputs.nixpkgs-unstable {
system = final.system;
config.allowUnfree = true;
};
};
}