This commit is contained in:
Daniel Flanagan 2024-07-30 15:16:46 -05:00
parent af7eaf7c57
commit c23487b544
5 changed files with 167 additions and 54 deletions

View file

@ -91,6 +91,22 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": { "flake-utils": {
"inputs": { "inputs": {
"systems": "systems" "systems": "systems"
@ -132,6 +148,30 @@
"type": "github" "type": "github"
} }
}, },
"git-hooks_2": {
"inputs": {
"flake-compat": "flake-compat_2",
"gitignore": "gitignore_2",
"nixpkgs": [
"slippi",
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable_2"
},
"locked": {
"lastModified": 1721042469,
"narHash": "sha256-6FPUl7HVtvRHCCBQne7Ylp4p+dpP3P/OYuzjztZ4s70=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "f451c19376071a90d8c58ab1a953c6e9840527fd",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": { "gitignore": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -153,6 +193,28 @@
"type": "github" "type": "github"
} }
}, },
"gitignore_2": {
"inputs": {
"nixpkgs": [
"slippi",
"git-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"hardware": { "hardware": {
"locked": { "locked": {
"lastModified": 1722017959, "lastModified": 1722017959,
@ -423,6 +485,22 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-stable_2": {
"locked": {
"lastModified": 1720386169,
"narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "194846768975b7ad2c4988bdb82572c00222c0d7",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1722040881, "lastModified": 1722040881,
@ -471,22 +549,6 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_4": {
"locked": {
"lastModified": 1716769173,
"narHash": "sha256-7EXDb5WBw+d004Agt+JHC/Oyh/KTUglOaQ4MNjBbo5w=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "9ca3f649614213b2aaf5f1e16ec06952fe4c2632",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"disko": "disko", "disko": "disko",
@ -529,20 +591,25 @@
}, },
"slippi": { "slippi": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_4" "git-hooks": "git-hooks_2",
"home-manager": [
"home-manager-unstable"
],
"nixpkgs": [
"nixpkgs-unstable"
]
}, },
"locked": { "locked": {
"lastModified": 1721686199, "dirtyRev": "5bfb7a3cc6c2bf124f5c1de080ee47b990674034-dirty",
"narHash": "sha256-4rMu207y5HCLkRDbZXdFhFqAfDKxwCJ1r9UOsXmef4Q=", "dirtyShortRev": "5bfb7a3-dirty",
"owner": "lytedev", "lastModified": 1722367638,
"repo": "slippi-nix", "narHash": "sha256-iUf05OQc/FejyhLgSfbYhAM3BDd/0TxSYe2XTF7atDU=",
"rev": "2b9673de8ec491be1c3ad8d23461b1fe5f2736b0", "type": "git",
"type": "github" "url": "file:///home/daniel/code/open-source/slippi-nix"
}, },
"original": { "original": {
"owner": "lytedev", "type": "git",
"repo": "slippi-nix", "url": "file:///home/daniel/code/open-source/slippi-nix"
"type": "github"
} }
}, },
"sops-nix": { "sops-nix": {

View file

@ -22,8 +22,10 @@
helix.url = "github:helix-editor/helix/master"; helix.url = "github:helix-editor/helix/master";
hardware.url = "github:nixos/nixos-hardware"; hardware.url = "github:nixos/nixos-hardware";
hyprland.url = "github:hyprwm/Hyprland"; hyprland.url = "github:hyprwm/Hyprland";
slippi.url = "github:lytedev/slippi-nix"; # slippi.url = "github:lytedev/slippi-nix/fix-recursion";
# slippi.url = "git+file:///home/daniel/code/open-source/slippi-nix"; slippi.url = "git+file:///home/daniel/code/open-source/slippi-nix";
slippi.inputs.nixpkgs.follows = "nixpkgs-unstable";
slippi.inputs.home-manager.follows = "home-manager-unstable";
# nnf.url = "github:thelegy/nixos-nftables-firewall?rev=71fc2b79358d0dbacde83c806a0f008ece567b7b"; # nnf.url = "github:thelegy/nixos-nftables-firewall?rev=71fc2b79358d0dbacde83c806a0f008ece567b7b";
}; };
@ -121,8 +123,7 @@
}: { }: {
default = mkShell { default = mkShell {
inherit (outputs.checks.${system}.git-hooks) shellHook; inherit (outputs.checks.${system}.git-hooks) shellHook;
packages = with pkgs; [
buildInputs = with pkgs; [
lua-language-server lua-language-server
nodePackages.bash-language-server nodePackages.bash-language-server
]; ];

View file

@ -67,7 +67,7 @@
]; ];
home-manager.users.daniel = { home-manager.users.daniel = {
slippi.launcher = { slippi-launcher = {
enable = true; enable = true;
isoPath = "${config.home-manager.users.daniel.home.homeDirectory}/../games/roms/dolphin/melee.iso"; isoPath = "${config.home-manager.users.daniel.home.homeDirectory}/../games/roms/dolphin/melee.iso";
launchMeleeOnPlay = false; launchMeleeOnPlay = false;

View file

@ -1,2 +1,3 @@
/target /target
/.direnv /.direnv
/.pre-commit-config.yaml

View file

@ -1,35 +1,79 @@
{ {
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
git-hooks.url = "github:cachix/git-hooks.nix";
git-hooks.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { outputs = {
self, self,
git-hooks,
nixpkgs, nixpkgs,
}: let }: let
inherit (self) outputs; inherit (self) outputs;
supportedSystems = [ systems = ["aarch64-linux" "aarch64-darwin" "x86_64-darwin" "x86_64-linux"];
"x86_64-linux" forSystems = nixpkgs.lib.genAttrs systems;
"aarch64-linux" pkgsFor = system: (import nixpkgs {inherit system;}).extend outputs.overlays.default;
genPkgs = func: (forSystems (system: func (pkgsFor system)));
"x86_64-darwin"
"aarch64-darwin"
];
forEachSupportedSystem = nixpkgs.lib.genAttrs supportedSystems;
in { in {
devShells = forEachSupportedSystem (system: let checks = genPkgs (pkgs: {
pkgs = import nixpkgs {inherit system;}; git-hooks = git-hooks.lib.${pkgs.system}.run {
in { src = ./.;
rust-dev = pkgs.mkShell { hooks = {
buildInputs = with pkgs; [ alejandra.enable = true;
cargo # NOTE: These do not work well with `nix flake check` due to pure environments
rustc # https://github.com/cachix/git-hooks.nix/issues/452
rustfmt # cargo-check.enable = true;
rustPackages.clippy # clippy = {
rust-analyzer # enable = true;
lldb # packageOverrides.cargo = pkgs.cargo;
pkg-config # packageOverrides.clippy = pkgs.rustPackages.clippy;
]; # };
rustfmt = {
enable = true;
packageOverrides.rustfmt = pkgs.rustfmt;
};
};
};
});
packages = genPkgs (pkgs: {
my-package = pkgs.rustPlatform.buildRustPackage {
pname = "kodotag";
version = "0.1.0";
# nativeBuildInputs = with pkgs; [
# pkg-config
# clang
# ];
# buildInputs = with pkgs; [
# ];
src = ./.;
hash = pkgs.lib.fakeHash;
cargoHash = "sha256-W7VQlMktGsRPQL9VGVmxYV6C5u2eJ48S7eTpOM+3n8U=";
}; };
default = outputs.devShells.${system}.rust-dev; default = outputs.packages.${pkgs.system}.my-package;
}); });
devShells = genPkgs (pkgs: {
default = pkgs.mkShell {
inherit (self.checks.${pkgs.system}.git-hooks) shellHook;
inputsFrom = [outputs.packages.${pkgs.system}.default];
packages = with pkgs; [
rustPackages.clippy
rust-analyzer
rustfmt
lldb
];
};
});
overlays = {
default = final: prev: {};
};
formatter = genPkgs (p: p.alejandra);
}; };
} }