Compare commits

..

1 commit

Author SHA1 Message Date
cy
2ef6714753 init flake-parts 2025-01-13 14:49:56 -05:00
9 changed files with 111 additions and 161 deletions

65
flake.lock generated
View file

@ -49,11 +49,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1736864502, "lastModified": 1734088167,
"narHash": "sha256-ItkIZyebGvNH2dK9jVGzJHGPtb6BSWLN8Gmef16NeY0=", "narHash": "sha256-snPBgTqwn3FPZVdFC5yt7Bnk3squim1vZOZ8CObWykk=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "0141aabed359f063de7413f80d906e1d98c0c123", "rev": "65a441502c9382d41ada1adbc9bd31d6c9b00fe2",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -94,6 +94,26 @@
} }
}, },
"flake-parts": { "flake-parts": {
"inputs": {
"nixpkgs-lib": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1736143030,
"narHash": "sha256-+hu54pAoLDEZT9pjHlqL9DNzWz0NbUn8NEAHP7PQPzU=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "b905f6fc23a9051a6e1b741e1438dbfc0634c6de",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_2": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
"lanzaboote", "lanzaboote",
@ -114,7 +134,7 @@
"type": "github" "type": "github"
} }
}, },
"flake-parts_2": { "flake-parts_3": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
"nixvim", "nixvim",
@ -248,11 +268,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1736785676, "lastModified": 1736508663,
"narHash": "sha256-TY0jUwR3EW0fnS0X5wXMAVy6h4Z7Y6a3m+Yq++C9AyE=", "narHash": "sha256-ZOaGwa+WnB7Zn3YXimqjmIugAnHePdXCmNu+AHkq808=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "fc52a210b60f2f52c74eac41a8647c1573d2071d", "rev": "2532b500c3ed2b8940e831039dcec5a5ea093afc",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -314,7 +334,7 @@
"inputs": { "inputs": {
"crane": "crane", "crane": "crane",
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
"flake-parts": "flake-parts", "flake-parts": "flake-parts_2",
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
@ -360,16 +380,16 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1736966948, "lastModified": 1736523798,
"narHash": "sha256-j9ysmoP7UJUEZdA1/Gjqa8zsx5gaq35PxRsaTBwgoWk=", "narHash": "sha256-Xb8mke6UCYjge9kPR9o4P1nVrhk7QBbKv3xQ9cj7h2s=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "69b5cebd7cc197ee5885fa694465039c42a5c8dc", "rev": "130595eba61081acde9001f43de3248d8888ac4a",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"ref": "nixos-unstable-small", "ref": "nixos-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
@ -392,11 +412,11 @@
}, },
"nixpkgs-garage": { "nixpkgs-garage": {
"locked": { "locked": {
"lastModified": 1736921030, "lastModified": 1736657901,
"narHash": "sha256-A7knAvBOwoM5X7oNdIOKvuXYtXJpuR4O8iKHIk8EwOI=", "narHash": "sha256-KpbFF8d5cqcBF7+m5fXDcPn+ADg3kURbX49JGx18NXU=",
"owner": "cything", "owner": "cything",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "97f27249297bf5fbc563014ae9d4884dee27f1e0", "rev": "616be0a7b830a10d0874d569aabd40034c9151aa",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -426,7 +446,7 @@
"inputs": { "inputs": {
"devshell": "devshell", "devshell": "devshell",
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat_2",
"flake-parts": "flake-parts_2", "flake-parts": "flake-parts_3",
"git-hooks": "git-hooks", "git-hooks": "git-hooks",
"home-manager": "home-manager_2", "home-manager": "home-manager_2",
"nix-darwin": "nix-darwin", "nix-darwin": "nix-darwin",
@ -437,11 +457,11 @@
"treefmt-nix": "treefmt-nix" "treefmt-nix": "treefmt-nix"
}, },
"locked": { "locked": {
"lastModified": 1736964246, "lastModified": 1736715511,
"narHash": "sha256-gb3ujURRlI/D5Jc8PUDOpJr8RyrTwnDDIDtnQK4upso=", "narHash": "sha256-5YAiZ3wrEJ/fzFoCwNf14xqfRTvgdcnl/+y0vye3Y6A=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixvim", "repo": "nixvim",
"rev": "5b068e7f8f2b6beaa1fafe0c8b3604b63bcccc2d", "rev": "35d6c12626f9895cd5d8ccf5d19c3d00de394334",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -503,6 +523,7 @@
"root": { "root": {
"inputs": { "inputs": {
"disko": "disko", "disko": "disko",
"flake-parts": "flake-parts",
"home-manager": "home-manager", "home-manager": "home-manager",
"lanzaboote": "lanzaboote", "lanzaboote": "lanzaboote",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
@ -545,11 +566,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1736808430, "lastModified": 1736515725,
"narHash": "sha256-wlgdf/n7bJMLBheqt1jmPoxJFrUP6FByKQFXuM9YvIk=", "narHash": "sha256-4P99yL8vGehwzytkpP87eklBePt6aqeEC5JFsIzhfUs=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "553c7cb22fed19fd60eb310423fdc93045c51ba8", "rev": "f214c1b76c347a4e9c8fb68c73d4293a6820d125",
"type": "github" "type": "github"
}, },
"original": { "original": {

138
flake.nix
View file

@ -2,7 +2,7 @@
description = "cy's flake"; description = "cy's flake";
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable-small"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
sops-nix = { sops-nix = {
url = "github:Mic92/sops-nix"; url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@ -27,6 +27,8 @@
url = "github:nix-community/nixvim"; url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
nixpkgs-btrbk.url = "github:cything/nixpkgs/btrbk"; # unmerged PR nixpkgs-btrbk.url = "github:cything/nixpkgs/btrbk"; # unmerged PR
nixpkgs-garage.url = "github:cything/nixpkgs/garage-module"; # unmerged PR nixpkgs-garage.url = "github:cything/nixpkgs/garage-module"; # unmerged PR
@ -47,38 +49,22 @@
}; };
outputs = outputs =
{ inputs@{ flake-parts, nixpkgs, home-manager, disko, ...}:
self, flake-parts.lib.mkFlake { inherit inputs; } {
nixpkgs, systems = [
home-manager, "x86_64-linux"
treefmt, ];
disko, imports = [
... inputs.treefmt.flakeModule
}@inputs: ];
let perSystem =
lib = nixpkgs.lib; {
inherit (self) outputs; self',
system,
systems = [ "x86_64-linux" ]; ...
forEachSystem = f: lib.genAttrs systems (system: f pkgsFor.${system}); }:
overlays = [ {
# (overlayPkgsFromFlake inputs.eza [ treefmt = {
# ])
] ++ import ./overlay;
pkgsFor = lib.genAttrs systems (
system:
import nixpkgs {
inherit system overlays;
config = {
allowUnfree = true;
};
}
);
treefmtEval = forEachSystem (
pkgs:
treefmt.lib.evalModule pkgs {
projectRootFile = "flake.nix"; projectRootFile = "flake.nix";
programs.nixfmt.enable = true; programs.nixfmt.enable = true;
programs.stylua.enable = true; programs.stylua.enable = true;
@ -88,24 +74,29 @@
programs.deadnix.enable = true; programs.deadnix.enable = true;
settings.global.excludes = [ "secrets/*" ]; settings.global.excludes = [ "secrets/*" ];
} };
); };
in
{
formatter = forEachSystem (pkgs: treefmtEval.${pkgs.system}.config.build.wrapper);
checks = forEachSystem (pkgs: {
formatting = treefmtEval.${pkgs.system}.config.build.check self;
});
# lets us build overlaid packages with `nix build .#<package>`
packages = pkgsFor;
nixosConfigurations = flake.nixosConfigurations =
let let
pkgs = pkgsFor.x86_64-linux; lib = nixpkgs.lib;
in
overlays = [
# (overlayPkgsFromFlake inputs.eza [
# ])
] ++ import ./overlay;
pkgs =
import nixpkgs {
inherit overlays;
config = {
allowUnfree = true;
};
};
in
{ {
ytnix = lib.nixosSystem { ytnix = lib.nixosSystem {
specialArgs = { inherit inputs outputs; }; specialArgs = { inherit inputs; };
modules = [ modules = [
{ {
nixpkgs = { inherit pkgs; }; nixpkgs = { inherit pkgs; };
@ -118,7 +109,7 @@
}; };
chunk = lib.nixosSystem { chunk = lib.nixosSystem {
specialArgs = { inherit inputs outputs; }; specialArgs = { inherit inputs; };
modules = [ modules = [
{ {
nixpkgs = { inherit pkgs; }; nixpkgs = { inherit pkgs; };
@ -134,7 +125,7 @@
}; };
titan = lib.nixosSystem { titan = lib.nixosSystem {
specialArgs = { inherit inputs outputs; }; specialArgs = { inherit inputs; };
modules = [ modules = [
{ {
nixpkgs = { inherit pkgs; }; nixpkgs = { inherit pkgs; };
@ -147,33 +138,24 @@
}; };
}; };
homeConfigurations = { # homeConfigurations = {
"yt@ytnix" = home-manager.lib.homeManagerConfiguration { # "yt@ytnix" = home-manager.lib.homeManagerConfiguration {
pkgs = pkgsFor.x86_64-linux; # inherit pkgs;
extraSpecialArgs = { inherit inputs outputs; }; # extraSpecialArgs = { inherit inputs; };
modules = [ # modules = [
./home/yt/ytnix.nix # ./home/yt/ytnix.nix
inputs.nixvim.homeManagerModules.nixvim # inputs.nixvim.homeManagerModules.nixvim
]; # ];
}; # };
#
"yt@chunk" = home-manager.lib.homeManagerConfiguration { # "yt@chunk" = home-manager.lib.homeManagerConfiguration {
pkgs = pkgsFor.x86_64-linux; # inherit pkgs;
extraSpecialArgs = { inherit inputs outputs; }; # extraSpecialArgs = { inherit inputs; };
modules = [ # modules = [
./home/yt/chunk.nix # ./home/yt/chunk.nix
inputs.nixvim.homeManagerModules.nixvim # inputs.nixvim.homeManagerModules.nixvim
]; # ];
}; # };
# };
"codespace@codespace" = home-manager.lib.homeManagerConfiguration {
pkgs = pkgsFor.x86_64-linux;
extraSpecialArgs = { inherit inputs outputs; };
modules = [
./home/yt/codespace.nix
inputs.nixvim.homeManagerModules.nixvim
];
};
};
}; };
} }

View file

@ -95,8 +95,8 @@
"<C-h>" = "cmp.mapping.abort()"; "<C-h>" = "cmp.mapping.abort()";
"<C-n>" = "cmp.mapping.select_next_item()"; "<C-n>" = "cmp.mapping.select_next_item()";
"<C-p>" = "cmp.mapping.select_prev_item()"; "<C-p>" = "cmp.mapping.select_prev_item()";
"<C-u>" = "cmp.mapping.scroll_docs(-4)"; "<C-d>" = "cmp.mapping.scroll_docs(-4)";
"<C-d>" = "cmp.mapping.scroll_docs(4)"; "<C-u>" = "cmp.mapping.scroll_docs(4)";
"<C-k>" = '' "<C-k>" = ''
cmp.mapping(function(fallback) cmp.mapping(function(fallback)
if cmp.visible() then if cmp.visible() then
@ -147,7 +147,7 @@
servers = { servers = {
bashls.enable = true; bashls.enable = true;
lua_ls.enable = true; lua_ls.enable = true;
nixd.enable = true; nil_ls.enable = true;
rust_analyzer = { rust_analyzer = {
enable = true; enable = true;
installRustc = true; installRustc = true;
@ -163,20 +163,14 @@
plugins.fzf-lua = { plugins.fzf-lua = {
enable = true; enable = true;
keymaps = { keymaps = {
"<leader>ff" = "files"; "<leader>ff" = "git_files";
"<leader>fg" = "live_grep"; "<leader>fg" = "live_grep";
}; };
}; };
plugins.neo-tree = { plugins.neo-tree = {
enable = true; enable = true;
buffers.followCurrentFile.enabled = true; closeIfLastWindow = true;
window.width = 30;
};
plugins.gitsigns = {
enable = true;
settings.current_line_blame = true;
}; };
plugins.cmp-buffer.enable = true; plugins.cmp-buffer.enable = true;
@ -188,8 +182,6 @@
plugins.nvim-autopairs.enable = true; plugins.nvim-autopairs.enable = true;
plugins.rainbow-delimiters.enable = true; plugins.rainbow-delimiters.enable = true;
plugins.web-devicons.enable = true; plugins.web-devicons.enable = true;
plugins.auto-save.enable = true; plugins.gitsigns.enable = true;
plugins.indent-blankline.enable = true;
plugins.undotree.enable = true;
}; };
} }

View file

@ -1,17 +0,0 @@
{pkgs, ...}: {
programs.vscode = {
enable = true;
package = pkgs.vscodium;
enableUpdateCheck = false;
enableExtensionUpdateCheck = false;
mutableExtensionsDir = false;
extensions = with pkgs.vscode-extensions; [
vscodevim.vim
jnoortheen.nix-ide # nix language support
editorconfig.editorconfig # editorconfig
dracula-theme.theme-dracula # color scheme
tomoki1207.pdf # pdf viewer
yzhang.markdown-all-in-one # markdown tools
];
};
}

View file

@ -1,22 +0,0 @@
{
pkgs,
...
}:
{
imports = [
./common.nix
];
home = {
username = "codespace";
homeDirectory = "/home/codespace";
stateVersion = "24.05";
};
programs.home-manager.enable = true;
systemd.user.startServices = "sd-switch";
home.packages = with pkgs; [
foot.terminfo
attic-client
];
}

View file

@ -30,7 +30,7 @@
programs.git = { programs.git = {
enable = true; enable = true;
userName = "cy"; userName = "cy";
userEmail = "cy@cy7.sh"; userEmail = "hi@cything.io";
delta = { delta = {
enable = true; enable = true;
options = { options = {

View file

@ -138,9 +138,4 @@
}; };
services.gnome-keyring.enable = true; services.gnome-keyring.enable = true;
programs.direnv = {
enable = true;
nix-direnv.enable = true;
};
} }

View file

@ -116,5 +116,4 @@
programs.zoxide.enableZshIntegration = true; programs.zoxide.enableZshIntegration = true;
programs.eza.enableZshIntegration = true; programs.eza.enableZshIntegration = true;
programs.nix-index.enableZshIntegration = false; programs.nix-index.enableZshIntegration = false;
programs.direnv.enableZshIntegration = false;
} }

View file

@ -10,7 +10,7 @@
HTTP_PORT = 3000; HTTP_PORT = 3000;
HTTP_ADDR = "127.0.0.1"; HTTP_ADDR = "127.0.0.1";
DOMAIN = "git.cy7.sh"; DOMAIN = "git.cy7.sh";
LANDING_PAGE = "explore"; LANDING_PAGE = "/cy";
}; };
session.COOKIE_SECURE = true; session.COOKIE_SECURE = true;
service.DISABLE_REGISTRATION = true; service.DISABLE_REGISTRATION = true;