Switch to flake.parts
This commit is contained in:
129
flake.lock
generated
129
flake.lock
generated
@@ -1,24 +1,139 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"nixpkgs": {
|
"flake-compat": {
|
||||||
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1754214453,
|
"lastModified": 1767039857,
|
||||||
"narHash": "sha256-Q/I2xJn/j1wpkGhWkQnm20nShYnG7TI99foDBpXm1SY=",
|
"narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "flake-compat",
|
||||||
"rev": "5b09dc45f24cf32316283e62aec81ffee3c3e376",
|
"rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"ref": "nixos-unstable",
|
"repo": "flake-compat",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-parts": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs-lib": "nixpkgs-lib"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1765835352,
|
||||||
|
"narHash": "sha256-XswHlK/Qtjasvhd1nOa1e8MgZ8GS//jBoTqWtrS1Giw=",
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "flake-parts",
|
||||||
|
"rev": "a34fae9c08a15ad73f295041fec82323541400a9",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "flake-parts",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"git-hooks-nix": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-compat": "flake-compat",
|
||||||
|
"gitignore": "gitignore",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1767281941,
|
||||||
|
"narHash": "sha256-6MkqajPICgugsuZ92OMoQcgSHnD6sJHwk8AxvMcIgTE=",
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "git-hooks.nix",
|
||||||
|
"rev": "f0927703b7b1c8d97511c4116eb9b4ec6645a0fa",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "git-hooks.nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"gitignore": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"git-hooks-nix",
|
||||||
|
"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"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1767364772,
|
||||||
|
"narHash": "sha256-fFUnEYMla8b7UKjijLnMe+oVFOz6HjijGGNS1l7dYaQ=",
|
||||||
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
|
"rev": "16c7794d0a28b5a37904d55bcca36003b9109aaa",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixpkgs-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs-lib": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1765674936,
|
||||||
|
"narHash": "sha256-k00uTP4JNfmejrCLJOwdObYC9jHRrr/5M/a/8L2EIdo=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nixpkgs.lib",
|
||||||
|
"rev": "2075416fcb47225d9b68ac469a5c4801a9c4dd85",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nixpkgs.lib",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": "nixpkgs"
|
"flake-parts": "flake-parts",
|
||||||
|
"git-hooks-nix": "git-hooks-nix",
|
||||||
|
"nixpkgs": "nixpkgs",
|
||||||
|
"treefmt-nix": "treefmt-nix"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"treefmt-nix": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1767468822,
|
||||||
|
"narHash": "sha256-MpffQxHxmjVKMiQd0Tg2IM/bSjjdQAM+NDcX6yxj7rE=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "treefmt-nix",
|
||||||
|
"rev": "d56486eb9493ad9c4777c65932618e9c2d0468fc",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "treefmt-nix",
|
||||||
|
"type": "github"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
108
flake.nix
108
flake.nix
@@ -29,33 +29,67 @@
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||||
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||||
|
|
||||||
|
git-hooks-nix.url = "github:cachix/git-hooks.nix";
|
||||||
|
git-hooks-nix.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
treefmt-nix.url = "github:numtide/treefmt-nix";
|
||||||
|
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs = inputs @ {flake-parts, ...}:
|
||||||
{ self, nixpkgs }:
|
flake-parts.lib.mkFlake {inherit inputs;} {
|
||||||
{
|
imports = [
|
||||||
devShell.x86_64-linux =
|
# To import a flake module
|
||||||
let
|
# 1. Add foo to inputs
|
||||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
# 2. Add foo as a parameter to the outputs function
|
||||||
|
# 3. Add here: foo.flakeModule
|
||||||
|
inputs.git-hooks-nix.flakeModule
|
||||||
|
inputs.treefmt-nix.flakeModule
|
||||||
|
];
|
||||||
|
systems = [
|
||||||
|
"x86_64-linux"
|
||||||
|
# "aarch64-linux"
|
||||||
|
# "aarch64-darwin"
|
||||||
|
# "x86_64-darwin"
|
||||||
|
];
|
||||||
|
flake = {
|
||||||
|
# The usual flake attributes can be defined here, including system-
|
||||||
|
# agnostic ones like nixosModule and system-enumerating ones, although
|
||||||
|
# those are more easily expressed in perSystem.
|
||||||
|
};
|
||||||
|
perSystem = {
|
||||||
|
config,
|
||||||
|
self',
|
||||||
|
inputs',
|
||||||
|
pkgs,
|
||||||
|
system,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
# Per-system attributes can be defined here. The self' and inputs'
|
||||||
|
# module parameters provide easy access to attributes of the same
|
||||||
|
# system.
|
||||||
|
|
||||||
ghc' = pkgs.haskell.packages.ghc984.ghcWithHoogle (
|
# Equivalent to inputs'.nixpkgs.legacyPackages.hello;
|
||||||
self: with self; [
|
# packages.default = pkgs.hello;
|
||||||
|
|
||||||
|
devShells.default = let
|
||||||
|
ghc' = pkgs.haskell.packages.ghc914.ghcWithHoogle (
|
||||||
|
self:
|
||||||
|
with self; [
|
||||||
relude
|
relude
|
||||||
split
|
split
|
||||||
|
|
||||||
aeson
|
aeson
|
||||||
random
|
random
|
||||||
neat-interpolation
|
neat-interpolation
|
||||||
|
|
||||||
# maths
|
# maths
|
||||||
primes
|
primes
|
||||||
arithmoi
|
arithmoi
|
||||||
parallel
|
parallel
|
||||||
|
|
||||||
# graphing libraries!
|
# graphing libraries!
|
||||||
# Chart
|
Chart
|
||||||
# Chart-cairo
|
Chart-cairo
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -72,25 +106,26 @@
|
|||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
pkgs.mkShell {
|
pkgs.mkShell {
|
||||||
buildInputs =
|
packages = with pkgs; [
|
||||||
with pkgs.haskellPackages;
|
haskell.compiler.native-bignum.ghc9141
|
||||||
[
|
|
||||||
ghc'
|
cowsay
|
||||||
|
|
||||||
|
alejandra
|
||||||
|
|
||||||
|
# ghc'
|
||||||
|
clean
|
||||||
|
|
||||||
haskell-language-server
|
haskell-language-server
|
||||||
ghcid
|
ghcid
|
||||||
hlint
|
hlint
|
||||||
]
|
|
||||||
++ (with pkgs; [
|
|
||||||
kotlin
|
|
||||||
jdk23
|
|
||||||
nixfmt-rfc-style
|
|
||||||
|
|
||||||
# Scripts
|
kotlin
|
||||||
clean
|
];
|
||||||
]);
|
|
||||||
|
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
|
${config.pre-commit.installationScript}
|
||||||
|
|
||||||
echo ".------..------..------..------..------..------..------..------..------..------."
|
echo ".------..------..------..------..------..------..------..------..------..------."
|
||||||
echo "|U.--. ||N.--. ||I.--. ||V.--. ||E.--. ||R.--. ||S.--. ||A.--. ||L.--. ||=.--. |"
|
echo "|U.--. ||N.--. ||I.--. ||V.--. ||E.--. ||R.--. ||S.--. ||A.--. ||L.--. ||=.--. |"
|
||||||
echo "| (\/) || :(): || (\/) || :(): || (\/) || :(): || :/\: || (\/) || :/\: || (\/) |"
|
echo "| (\/) || :(): || (\/) || :(): || (\/) || :(): || :/\: || (\/) || :/\: || (\/) |"
|
||||||
@@ -120,5 +155,26 @@
|
|||||||
echo " \____/ \__,_||_| \___| \__,_||_| \__,_| \__| \___/ |_| "
|
echo " \____/ \__,_||_| \___| \__,_||_| \__,_| \__| \___/ |_| "
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
pre-commit = {
|
||||||
|
settings.hooks = {
|
||||||
|
alejandra.enable = true;
|
||||||
|
mdformat.enable = true;
|
||||||
|
prettier.enable = true;
|
||||||
|
prettier.excludes = [".*\.md" "flake.lock"];
|
||||||
|
stylish-haskell.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
treefmt = {
|
||||||
|
programs = {
|
||||||
|
alejandra.enable = true;
|
||||||
|
mdformat.enable = true;
|
||||||
|
prettier.enable = true;
|
||||||
|
prettier.excludes = ["*.md"];
|
||||||
|
stylish-haskell.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user