init
This commit is contained in:
commit
0df1237eb2
19 changed files with 1921 additions and 0 deletions
135
flake.nix
Normal file
135
flake.nix
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
{
|
||||
description = "A very basic flake";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||
c3d2-user-module.url = "git+https://gitea.c3d2.de/C3D2/nix-user-module.git";
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
niri.url = "github:sodiboo/niri-flake";
|
||||
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
|
||||
treefmt-nix = {
|
||||
url = "github:numtide/treefmt-nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
determinate.url = "https://flakehub.com/f/DeterminateSystems/determinate/*";
|
||||
nix-index-db = {
|
||||
url = "github:Mic92/nix-index-database";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
quickshell = {
|
||||
url = "git+https://git.outfoxxed.me/quickshell/quickshell";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs =
|
||||
inputs@{ self
|
||||
, nixpkgs
|
||||
, c3d2-user-module
|
||||
, home-manager
|
||||
, niri
|
||||
, nixos-hardware
|
||||
, treefmt-nix
|
||||
, determinate
|
||||
, nix-index-db
|
||||
, quickshell
|
||||
,
|
||||
}:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
|
||||
# Configure treefmt
|
||||
treefmtEval = treefmt-nix.lib.evalModule pkgs {
|
||||
projectRootFile = "flake.nix";
|
||||
programs = {
|
||||
nixpkgs-fmt.enable = true;
|
||||
prettier = {
|
||||
enable = true;
|
||||
includes = [
|
||||
"*.json"
|
||||
"*.yaml"
|
||||
"*.yml"
|
||||
];
|
||||
};
|
||||
taplo.enable = true;
|
||||
};
|
||||
|
||||
settings = {
|
||||
global.excludes = [
|
||||
"*.lock"
|
||||
"result"
|
||||
".git/"
|
||||
"*.md"
|
||||
"*.sh"
|
||||
"*.py"
|
||||
"*.js"
|
||||
"*.ts"
|
||||
];
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
nixosConfigurations.p50 = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = { inherit inputs; };
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
niri.nixosModules.niri
|
||||
nixos-hardware.nixosModules.lenovo-thinkpad-p50
|
||||
./configuration.nix
|
||||
determinate.nixosModules.default
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.users.lucy =
|
||||
{ config
|
||||
, pkgs
|
||||
, lib
|
||||
, inputs
|
||||
, ...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./modules/home.nix
|
||||
];
|
||||
|
||||
# Configure dconf settings here or inside home.nix
|
||||
# Example:
|
||||
# home.sessionVariables = {
|
||||
# XDG_CURRENT_DESKTOP = "GNOME";
|
||||
# };
|
||||
};
|
||||
}
|
||||
c3d2-user-module.nixosModule
|
||||
./modules/nix.nix
|
||||
./modules/fonts.nix
|
||||
];
|
||||
};
|
||||
|
||||
# Add treefmt formatter
|
||||
formatter.${system} = treefmtEval.config.build.wrapper;
|
||||
|
||||
# Optional: Add a dev shell with treefmt
|
||||
devShells.${system}.default = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
git
|
||||
treefmtEval.config.build.wrapper
|
||||
];
|
||||
|
||||
shellHook = ''
|
||||
echo "Development shell loaded!"
|
||||
echo "Run 'nix fmt' to format all files"
|
||||
echo "Run 'treefmt' to format with treefmt directly"
|
||||
'';
|
||||
};
|
||||
|
||||
# Optional: Add formatting check
|
||||
checks.${system} = {
|
||||
formatting = treefmtEval.config.build.check self;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue