configuration.nix/flake.nix

263 lines
7.1 KiB
Nix
Raw Normal View History

2024-01-14 17:33:16 +01:00
# This flake was initially generated by fh, the CLI for FlakeHub (version 0.1.9)
{
# A helpful description of your flake
description = "My NixOS configuration";
# Flake inputs
2024-05-10 23:21:26 +02:00
inputs = {
nixpkgs.url = "nixpkgs/nixos-24.05";
unstable.url = "nixpkgs/nixos-unstable";
2024-05-10 23:21:26 +02:00
# Software
jpassmenu = {
url = "github:jalil-salame/jpassmenu";
inputs.nixpkgs.follows = "nixpkgs";
};
audiomenu = {
url = "github:jalil-salame/audiomenu";
inputs.nixpkgs.follows = "nixpkgs";
};
# Lix
lix-module = {
url = "https://git.lix.systems/lix-project/nixos-module/archive/2.90.0-rc1.tar.gz";
2024-05-10 23:21:26 +02:00
inputs = {
nixpkgs.follows = "nixpkgs";
2024-05-17 18:20:21 +02:00
flake-utils.follows = "flake-utils";
2024-05-10 23:21:26 +02:00
};
};
# Modules
home-manager = {
url = "github:nix-community/home-manager/release-24.05";
2024-05-10 23:21:26 +02:00
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-hardware.url = "github:NixOS/nixos-hardware";
# FIXME: pin to 24.05 when avalialble
2024-05-10 23:21:26 +02:00
stylix = {
url = "github:danth/stylix/release-24.05";
2024-05-10 23:21:26 +02:00
inputs = {
nixpkgs.follows = "nixpkgs";
home-manager.follows = "home-manager";
};
};
nixvim = {
url = "github:nix-community/nixvim";
inputs = {
[chore] flake.lock: update Also fix neovim errors Flake lock file updates: • Updated input 'home-manager': 'github:nix-community/home-manager/845a5c4c073f74105022533907703441e0464bc3?narHash=sha256-vWSkg6AMok1UUQiSYVdGMOXKD2cDFnajITiSi0Zjd1A%3D' (2024-06-04) → 'github:nix-community/home-manager/a1fddf0967c33754271761d91a3d921772b30d0e?narHash=sha256-BmO8d0r%2BBVlwWtMLQEYnwmngqdXIuyFzMwvmTcLMee8%3D' (2024-06-16) • Updated input 'lix': 'https://git.lix.systems/api/v1/repos/lix-project/lix/archive/068576042b3b58f8180b24a36c07199a1a3fd380.tar.gz?narHash=sha256-/hsqsiw3p5qMpazedgFFZF2sQghbCJIoef7XCpegTXw%3D' (2024-06-13) → 'https://git.lix.systems/api/v1/repos/lix-project/lix/archive/e44dcd63c4d96807536cdcf2afb688a537cce9be.tar.gz?narHash=sha256-cAkgZoiP2eHB%2BV2cPJMcXACzdaWZIMgI5sg4vpH%2BDYo%3D' (2024-06-20) • Updated input 'lix-module': 'https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/4e25f1ab68f2270f9cff59216056c21073db0164.tar.gz?narHash=sha256-m8XYt8NU2T4gvkien7H7LFGXHhSA5z4tHOeuXQ3DJi4%3D' (2024-06-06) → 'https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/909e593ae9f5fe338ab19b4ed9d52bb0ea09bad8.tar.gz?narHash=sha256-DdcMvX9r29uHMlz7P1Shgs5xZw9WkZ4ObMGYzwROAiw%3D' (2024-06-19) • Updated input 'nixos-hardware': 'github:NixOS/nixos-hardware/ae5c8dcc4d0182d07d75df2dc97112de822cb9d6?narHash=sha256-SuPne4BMqh9/IkKIAG47Cu5qfmntAaqlHdX1yuFoDO0%3D' (2024-06-14) → 'github:NixOS/nixos-hardware/083823b7904e43a4fc1c7229781417e875359a42?narHash=sha256-hxQBUtDbFOCCW1CsFZTS9Q5Ov1ZKdJgbBZHSez1M6iA%3D' (2024-06-20) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/cc54fb41d13736e92229c21627ea4f22199fee6b?narHash=sha256-US1tAChvPxT52RV8GksWZS415tTS7PV42KTc2PNDBmc%3D' (2024-06-12) → 'github:NixOS/nixpkgs/dd457de7e08c6d06789b1f5b88fc9327f4d96309?narHash=sha256-wM9v2yIxClRYsGHut5vHICZTK7xdrUGfrLkXvSuv6s4%3D' (2024-06-19) • Updated input 'nixvim': 'github:nix-community/nixvim/7a2a25af02be25987aa43cd681312f4b5ba12317?narHash=sha256-NIJZxmY2CWsqJK/9BQCRSHfcCY9K6thjq/1XtJobxmU%3D' (2024-06-14) → 'github:nix-community/nixvim/744dfea48bdd331e66b9e874822559fa6fae98af?narHash=sha256-artyEBzWUsNXtYj7jBr816wRJj2Y3DYDHw6ECrQotX0%3D' (2024-06-20) • Updated input 'nixvim/treefmt-nix': 'github:numtide/treefmt-nix/1cb529bffa880746a1d0ec4e0f5076876af931f1?narHash=sha256-1TZQcdETNdJMcfwwoshVeCjwWfrPtkSQ8y8wFX3it7k%3D' (2024-06-11) → 'github:numtide/treefmt-nix/68eb1dc333ce82d0ab0c0357363ea17c31ea1f81?narHash=sha256-ULzoKzEaBOiLRtjeY3YoGFJMwWSKRYOic6VNw2UyTls%3D' (2024-06-16) • Updated input 'unstable': 'github:NixOS/nixpkgs/e9ee548d90ff586a6471b4ae80ae9cfcbceb3420?narHash=sha256-4Zu0RYRcAY/VWuu6awwq4opuiD//ahpc2aFHg2CWqFY%3D' (2024-06-13) → 'github:NixOS/nixpkgs/c00d587b1a1afbf200b1d8f0b0e4ba9deb1c7f0e?narHash=sha256-FUZpz9rg3gL8NVPKbqU8ei1VkPLsTIfAJ2fdAf5qjak%3D' (2024-06-18)
2024-06-21 06:30:18 +02:00
nixpkgs.follows = "unstable";
2024-05-17 18:20:21 +02:00
devshell.follows = "devshell";
nix-darwin.follows = ""; # disable MacOS stuff
2024-05-10 23:21:26 +02:00
home-manager.follows = "home-manager";
2024-05-17 18:20:21 +02:00
flake-compat.follows = "stylix/flake-compat";
};
};
# For deduplication
systems.url = "github:nix-systems/default";
flake-utils = {
url = "github:numtide/flake-utils";
inputs.systems.follows = "systems";
};
devshell = {
url = "github:numtide/devshell";
inputs = {
flake-utils.follows = "flake-utils";
nixpkgs.follows = "nixpkgs";
};
};
2024-05-10 23:21:26 +02:00
};
2024-05-10 21:47:38 +02:00
2024-01-14 17:33:16 +01:00
# Flake outputs that other flakes can use
2024-05-04 20:57:33 +02:00
outputs = {
self,
nixpkgs,
unstable,
2024-05-04 20:57:33 +02:00
stylix,
home-manager,
nixos-hardware,
jpassmenu,
audiomenu,
nixvim,
2024-05-10 21:47:38 +02:00
lix-module,
2024-05-17 18:20:21 +02:00
...
2024-05-04 20:57:33 +02:00
}: let
inherit (nixpkgs) lib;
# Helpers for producing system-specific outputs
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
];
forEachSupportedSystem = f:
nixpkgs.lib.genAttrs supportedSystems (
system:
f {
inherit system;
pkgs = nixpkgs.legacyPackages.${system};
}
);
2024-05-04 20:57:33 +02:00
overlays = builtins.attrValues self.overlays;
in {
checks = forEachSupportedSystem (
{
pkgs,
system,
}: let
src = builtins.path {
path = ./.;
name = "configuration.nix";
};
in {
2024-05-04 20:57:33 +02:00
nvim = nixvim.lib.${system}.check.mkTestDerivationFromNixvimModule {
pkgs = import nixpkgs {inherit system overlays;};
module = ./nvim/standalone.nix;
2024-05-04 20:57:33 +02:00
};
2024-06-08 22:28:27 +02:00
fmt = pkgs.callPackage ./fmt.nix {inherit src;};
lint = pkgs.callPackage ./lint.nix {inherit src;};
typos = pkgs.callPackage ./lint.nix {inherit src;};
2024-05-04 20:57:33 +02:00
}
);
packages = forEachSupportedSystem (
{
pkgs,
system,
}: {
inherit
(import ./docs {inherit pkgs lib;})
docs
nixos-markdown
nvim-markdown
home-markdown
;
# Nvim standalone module
nvim = nixvim.legacyPackages.${system}.makeNixvimWithModule {
pkgs = import nixpkgs {inherit system overlays;};
module = ./nvim/standalone.nix;
};
2024-05-04 20:57:33 +02:00
}
);
# Provide necessary overlays
overlays = {
nixvim = nixvim.overlays.default;
jpassmenu = jpassmenu.overlays.default;
audiomenu = audiomenu.overlays.default;
[chore] flake.lock: update inputs Fix for OpenSSH vulnerability: ``` • Updated input 'home-manager': 'github:nix-community/home-manager/a1fddf0967c33754271761d91a3d921772b30d0e' (2024-06-16) → 'github:nix-community/home-manager/391ca6e950c2525b4f853cbe29922452c14eda82' (2024-07-01) • Updated input 'nixos-hardware': 'github:NixOS/nixos-hardware/a59f00f5ac65b19382617ba00f360f8bc07ed3ac' (2024-06-29) → 'github:NixOS/nixos-hardware/6e253f12b1009053eff5344be5e835f604bb64cd' (2024-07-02) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/89c49874fb15f4124bf71ca5f42a04f2ee5825fd' (2024-06-26) → 'github:NixOS/nixpkgs/d032c1a6dfad4eedec7e35e91986becc699d7d69' (2024-07-01) • Updated input 'nixvim': 'github:nix-community/nixvim/c062b976eff9f13597c7c23d77a6b3ac677b7fd5' (2024-06-29) → 'github:nix-community/nixvim/079c2c479b5707adf0b03f817be30945c92c15cf' (2024-07-01) • Updated input 'nixvim/flake-parts': 'github:hercules-ci/flake-parts/2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8' (2024-06-01) → 'github:hercules-ci/flake-parts/c3c5ecc05edc7dafba779c6c1a61cd08ac6583e9' (2024-06-30) • Updated input 'nixvim/treefmt-nix': 'github:numtide/treefmt-nix/065a23edceff48f948816b795ea8cc6c0dee7cdf' (2024-06-24) → 'github:numtide/treefmt-nix/8df5ff62195d4e67e2264df0b7f5e8c9995fd0bd' (2024-06-30) • Updated input 'unstable': 'github:NixOS/nixpkgs/b2852eb9365c6de48ffb0dc2c9562591f652242a' (2024-06-27) → 'github:NixOS/nixpkgs/2741b4b489b55df32afac57bc4bfd220e8bf617e' (2024-06-29) ```
2024-06-30 14:03:24 +02:00
unstable = final: prev: let
unstablePkgs = unstable.legacyPackages.${prev.system};
in {
# Get unstable packages
unstable = unstablePkgs;
# Update vim plugins with the versions from unstable
vimPlugins = prev.vimPlugins // unstablePkgs.vimPlugins;
# Get specific packages from unstable
inherit
[chore] flake.lock: update inputs Fix for OpenSSH vulnerability: ``` • Updated input 'home-manager': 'github:nix-community/home-manager/a1fddf0967c33754271761d91a3d921772b30d0e' (2024-06-16) → 'github:nix-community/home-manager/391ca6e950c2525b4f853cbe29922452c14eda82' (2024-07-01) • Updated input 'nixos-hardware': 'github:NixOS/nixos-hardware/a59f00f5ac65b19382617ba00f360f8bc07ed3ac' (2024-06-29) → 'github:NixOS/nixos-hardware/6e253f12b1009053eff5344be5e835f604bb64cd' (2024-07-02) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/89c49874fb15f4124bf71ca5f42a04f2ee5825fd' (2024-06-26) → 'github:NixOS/nixpkgs/d032c1a6dfad4eedec7e35e91986becc699d7d69' (2024-07-01) • Updated input 'nixvim': 'github:nix-community/nixvim/c062b976eff9f13597c7c23d77a6b3ac677b7fd5' (2024-06-29) → 'github:nix-community/nixvim/079c2c479b5707adf0b03f817be30945c92c15cf' (2024-07-01) • Updated input 'nixvim/flake-parts': 'github:hercules-ci/flake-parts/2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8' (2024-06-01) → 'github:hercules-ci/flake-parts/c3c5ecc05edc7dafba779c6c1a61cd08ac6583e9' (2024-06-30) • Updated input 'nixvim/treefmt-nix': 'github:numtide/treefmt-nix/065a23edceff48f948816b795ea8cc6c0dee7cdf' (2024-06-24) → 'github:numtide/treefmt-nix/8df5ff62195d4e67e2264df0b7f5e8c9995fd0bd' (2024-06-30) • Updated input 'unstable': 'github:NixOS/nixpkgs/b2852eb9365c6de48ffb0dc2c9562591f652242a' (2024-06-27) → 'github:NixOS/nixpkgs/2741b4b489b55df32afac57bc4bfd220e8bf617e' (2024-06-29) ```
2024-06-30 14:03:24 +02:00
(unstablePkgs)
gitoxide
jujutsu
wezterm
[chore] flake.lock: update inputs Fix for OpenSSH vulnerability: ``` • Updated input 'home-manager': 'github:nix-community/home-manager/a1fddf0967c33754271761d91a3d921772b30d0e' (2024-06-16) → 'github:nix-community/home-manager/391ca6e950c2525b4f853cbe29922452c14eda82' (2024-07-01) • Updated input 'nixos-hardware': 'github:NixOS/nixos-hardware/a59f00f5ac65b19382617ba00f360f8bc07ed3ac' (2024-06-29) → 'github:NixOS/nixos-hardware/6e253f12b1009053eff5344be5e835f604bb64cd' (2024-07-02) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/89c49874fb15f4124bf71ca5f42a04f2ee5825fd' (2024-06-26) → 'github:NixOS/nixpkgs/d032c1a6dfad4eedec7e35e91986becc699d7d69' (2024-07-01) • Updated input 'nixvim': 'github:nix-community/nixvim/c062b976eff9f13597c7c23d77a6b3ac677b7fd5' (2024-06-29) → 'github:nix-community/nixvim/079c2c479b5707adf0b03f817be30945c92c15cf' (2024-07-01) • Updated input 'nixvim/flake-parts': 'github:hercules-ci/flake-parts/2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8' (2024-06-01) → 'github:hercules-ci/flake-parts/c3c5ecc05edc7dafba779c6c1a61cd08ac6583e9' (2024-06-30) • Updated input 'nixvim/treefmt-nix': 'github:numtide/treefmt-nix/065a23edceff48f948816b795ea8cc6c0dee7cdf' (2024-06-24) → 'github:numtide/treefmt-nix/8df5ff62195d4e67e2264df0b7f5e8c9995fd0bd' (2024-06-30) • Updated input 'unstable': 'github:NixOS/nixpkgs/b2852eb9365c6de48ffb0dc2c9562591f652242a' (2024-06-27) → 'github:NixOS/nixpkgs/2741b4b489b55df32afac57bc4bfd220e8bf617e' (2024-06-29) ```
2024-06-30 14:03:24 +02:00
neovim-unwrapped
;
};
2024-05-04 20:57:33 +02:00
};
2024-05-04 20:57:33 +02:00
# Nix files formatter (run `nix fmt`)
formatter = forEachSupportedSystem ({pkgs, ...}: pkgs.alejandra);
# Example vm configuration
nixosConfigurations.vm = let
system = "x86_64-linux";
config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) ["steam-original"];
pkgs = import nixpkgs {inherit system overlays config;};
in
lib.nixosSystem {
inherit system pkgs;
modules = [
self.nixosModules.vm # import vm module
{
time.timeZone = "Europe/Berlin";
i18n.defaultLocale = "en_US.UTF-8";
2024-05-17 18:50:01 +02:00
users.users.jdoe = {
password = "example";
isNormalUser = true;
extraGroups = [
"wheel"
"video"
"networkmanager"
];
};
2024-05-04 20:57:33 +02:00
home-manager.users.jdoe = {
2024-05-17 18:50:01 +02:00
home = {
username = "jdoe";
homeDirectory = "/home/jdoe";
};
jhome = {
enable = true;
gui.enable = true;
dev.rust.enable = true;
};
2024-05-04 20:57:33 +02:00
};
nix.registry.nixpkgs.flake = nixpkgs;
2024-05-17 18:50:01 +02:00
jconfig = {
enable = true;
gui.enable = true;
};
2024-05-04 20:57:33 +02:00
}
];
};
nixosModules = let
nvim-config.imports = [
nixvim.homeManagerModules.nixvim
./nvim
];
homeManagerModuleSandalone = import ./home {inherit nvim-config stylix;};
homeManagerModuleNixOS = import ./home {inherit nvim-config;};
2024-05-04 20:57:33 +02:00
nixosModule = {
2024-05-10 23:21:26 +02:00
imports =
[
(import ./system {inherit stylix;})
home-manager.nixosModules.home-manager
]
++ nixpkgs.lib.optional (lix-module != null) lix-module.nixosModules.default;
2024-05-17 18:50:01 +02:00
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
sharedModules = [homeManagerModuleNixOS];
};
2024-05-04 20:57:33 +02:00
# Pin nixpkgs
nix.registry.nixpkgs.flake = nixpkgs;
};
machines = [
"capricorn"
"gemini"
"libra"
"vm"
];
mkMachine = hostname: {
imports = [
nixosModule
(import (./machines + "/${hostname}") {inherit nixos-hardware;})
];
home-manager.sharedModules = [{jhome.hostName = hostname;}];
};
machineModules = lib.genAttrs machines mkMachine;
in
{
default = nixosModule;
inherit nixosModule homeManagerModuleNixOS homeManagerModuleSandalone;
}
// machineModules;
devShells = forEachSupportedSystem (
{
pkgs,
system,
}: {
default = pkgs.mkShell {
buildInputs = [
pkgs.just
2024-05-04 20:57:33 +02:00
self.packages.${system}.nvim
];
flake.lock: Update Replaced neovim with neovim-nightly-overlay as the flake from neovim was removed. Flake lock file updates: • Updated input 'home-manager': 'github:nix-community/home-manager/44677a1c96810a8e8c4ffaeaad10c842402647c1' (2024-05-12) → 'github:nix-community/home-manager/05e6ba83eb3585ce0aff7b41e4bd0e317d05ad4a' (2024-05-26) • Updated input 'lix': 'https://git.lix.systems/api/v1/repos/lix-project/lix/archive/005ee33a9a145f714f4837b1c0b5c430ac3bc588.tar.gz?narHash=sha256-%2Baa9ZALET2yJEDK5wmBUcFjj60/lNQqA4%2BDUPK0wzZE%3D' (2024-05-17) → 'https://git.lix.systems/api/v1/repos/lix-project/lix/archive/5986a720d47041b79ead2d1f58a172f410d29db5.tar.gz?narHash=sha256-VXsSaj3athaUjgbX9bovTNhSOgevU%2B8qWx9pgaQePdE%3D' (2024-05-26) • Updated input 'lix-module': 'https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/53d713eb486f21d653af3ef3528e9a19ecfc45e5.tar.gz?narHash=sha256-IUFYAl3158Ig5vySnRBHoPReb2/S97bjodCo6FhzJv4%3D' (2024-05-16) → 'https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/18fa4a89e208cb8e881f5f71c75bbd4c1c2fd37d.tar.gz?narHash=sha256-fzY708SyfHwLOFrg5ZU0fXW9mNdvRvqz64jg97vvpJM%3D' (2024-05-23) • Updated input 'neovim-flake': 'github:neovim/neovim/27fb62988e922c2739035f477f93cc052a4fee1e?dir=contrib' (2024-05-16) → 'github:nix-community/neovim-nightly-overlay/0f91f34a626baade98dfa091cc7a023266644d91' (2024-05-25) • Removed input 'neovim-flake/flake-utils' • Removed input 'neovim-flake/nixpkgs' • Added input 'neovim-src': 'github:neovim/neovim/27fb62988e922c2739035f477f93cc052a4fee1e' (2024-05-16) • Updated input 'nixos-hardware': 'github:NixOS/nixos-hardware/ff1be1e3cdf884df0935ab28745ab13c3c26d828' (2024-05-16) → 'github:NixOS/nixos-hardware/2e7d6c568063c83355fe066b8a8917ee758de1b8' (2024-05-26) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/33d1e753c82ffc557b4a585c77de43d4c922ebb5' (2024-05-15) → 'github:NixOS/nixpkgs/bfb7a882678e518398ce9a31a881538679f6f092' (2024-05-24) • Updated input 'nixvim': 'github:nix-community/nixvim/72ff1489c7f40dae829fafc689fb6a57099a9739' (2024-05-16) → 'github:nix-community/nixvim/8212bf1cd2d2dfe6ba521dd8c65a13b67e562d1a' (2024-05-26) • Updated input 'nixvim/flake-parts': 'github:hercules-ci/flake-parts/e5d10a24b66c3ea8f150e47dfdb0416ab7c3390e' (2024-05-02) → 'github:hercules-ci/flake-parts/8dc45382d5206bd292f9c2768b8058a8fd8311d9' (2024-05-16) • Updated input 'nixvim/treefmt-nix': 'github:numtide/treefmt-nix/c6aaf729f34a36c445618580a9f95a48f5e4e03f' (2024-04-25) → 'github:numtide/treefmt-nix/2fba33a182602b9d49f0b2440513e5ee091d838b' (2024-05-17) • Updated input 'pre-commit-hooks': 'github:cachix/pre-commit-hooks.nix/fa606cccd7b0ccebe2880051208e4a0f61bfc8c1' (2024-05-16) → 'github:cachix/pre-commit-hooks.nix/0e8fcc54b842ad8428c9e705cb5994eaf05c26a0' (2024-05-20) • Updated input 'stylix': 'github:jalil-salame/stylix/feeb35d2857ef6e32292ebdb862c2f6022c727fd' (2024-05-20) → 'github:jalil-salame/stylix/e5a4701b7d96c4909105a4c2366e4af3f188f802' (2024-05-24)
2024-05-24 06:29:14 +02:00
QEMU_OPTS_WL = "--enable-kvm -smp 4 -device virtio-gpu-rutabaga,gfxstream-vulkan=on,cross-domain=on,hostmem=2G,wsi=headless";
2024-05-04 20:57:33 +02:00
};
}
);
};
2024-01-14 17:33:16 +01:00
}