feat: havent commited in a looong time
This commit is contained in:
parent
c0eed7e133
commit
df4e195aeb
39
default.nix
39
default.nix
|
@ -4,7 +4,37 @@ in {
|
||||||
imports = [ "${sources.home-manager}/nixos" ./modules ];
|
imports = [ "${sources.home-manager}/nixos" ./modules ];
|
||||||
|
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
# boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
||||||
|
boot.loader = {
|
||||||
|
efi = {
|
||||||
|
canTouchEfiVariables = true;
|
||||||
|
# assuming /boot is the mount point of the EFI partition in NixOS (as the installation section recommends).
|
||||||
|
efiSysMountPoint = "/boot";
|
||||||
|
};
|
||||||
|
grub = {
|
||||||
|
# despite what the configuration.nix manpage seems to indicate,
|
||||||
|
# as of release 17.09, setting device to "nodev" will still call
|
||||||
|
# `grub-install` if efiSupport is true
|
||||||
|
# (the devices list is not used by the EFI grub install,
|
||||||
|
# but must be set to some value in order to pass an assert in grub.nix)
|
||||||
|
devices = [ "nodev" ];
|
||||||
|
efiSupport = true;
|
||||||
|
enable = true;
|
||||||
|
# set $FS_UUID to the UUID of the EFI partition
|
||||||
|
extraEntries = ''
|
||||||
|
menuentry "Windows" {
|
||||||
|
insmod part_gpt
|
||||||
|
insmod fat
|
||||||
|
insmod search_fs_uuid
|
||||||
|
insmod chain
|
||||||
|
search --fs-uuid --set=root $FS_UUID
|
||||||
|
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
version = 2;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# Enable the OpenSSH daemon.
|
# Enable the OpenSSH daemon.
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
|
@ -12,7 +42,10 @@ in {
|
||||||
# Enable sound.
|
# Enable sound.
|
||||||
sound.enable = true;
|
sound.enable = true;
|
||||||
|
|
||||||
# home-manager.users.adrielus.home.packages = with pkgs; [ bluez bluez-tools ];
|
home-manager.users.adrielus = {
|
||||||
|
manual.manpages.enable = false;
|
||||||
|
# home.packages = with pkgs; [ bluez bluez-tools ];
|
||||||
|
};
|
||||||
|
|
||||||
# Enable blueman
|
# Enable blueman
|
||||||
# services.blueman.enable = true;
|
# services.blueman.enable = true;
|
||||||
|
@ -57,6 +90,8 @@ in {
|
||||||
# Service.ExecStart = "${pkgs.bluez}/bin/mpris-proxy";
|
# Service.ExecStart = "${pkgs.bluez}/bin/mpris-proxy";
|
||||||
# Install.WantedBy = [ "default.target" ];
|
# Install.WantedBy = [ "default.target" ];
|
||||||
# };
|
# };
|
||||||
|
|
||||||
system.stateVersion = "20.03";
|
system.stateVersion = "20.03";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,16 +4,17 @@
|
||||||
./shells
|
./shells
|
||||||
# ./wakatime
|
# ./wakatime
|
||||||
./xmonad
|
./xmonad
|
||||||
|
./xmodmap
|
||||||
|
|
||||||
# ./wine.nix
|
# ./wine.nix
|
||||||
./steam.nix
|
./steam.nix
|
||||||
# ./docker.nix
|
./docker.nix
|
||||||
./misc.nix
|
./misc.nix
|
||||||
./locale.nix
|
./locale.nix
|
||||||
# ./memes.nix
|
# ./memes.nix
|
||||||
./alacritty.nix
|
./alacritty.nix
|
||||||
./rofi.nix
|
./rofi.nix
|
||||||
# ./postgres.nix
|
./postgres.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,14 @@
|
||||||
{ pkgs, ... }: {
|
{ pkgs, ... }: {
|
||||||
virtualisation.docker.enable = true;
|
virtualisation.docker = {
|
||||||
|
enable = true;
|
||||||
|
liveRestore = false;
|
||||||
|
extraOptions = ''
|
||||||
|
--default-address-pool "base=192.168.100.0/20,size=24"
|
||||||
|
'';
|
||||||
|
};
|
||||||
home-manager.users.adrielus.home.packages = with pkgs; [
|
home-manager.users.adrielus.home.packages = with pkgs; [
|
||||||
docker
|
docker
|
||||||
docker-compose
|
docker-compose
|
||||||
|
docker-machine
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
userName = "Matei Adriel";
|
userName = "Matei Adriel";
|
||||||
userEmail = "rafaeladriel11@gmail.com";
|
userEmail = "rafaeladriel11@gmail.com";
|
||||||
|
extraConfig.core.editor = "nvim";
|
||||||
|
|
||||||
aliases = import ./aliases.nix;
|
aliases = import ./aliases.nix;
|
||||||
|
|
||||||
|
|
|
@ -5,22 +5,29 @@
|
||||||
exa # ls replacement
|
exa # ls replacement
|
||||||
mkpasswd # hash passwords
|
mkpasswd # hash passwords
|
||||||
gnupg
|
gnupg
|
||||||
typespeed # speed typing game
|
# typespeed # speed typing game
|
||||||
unixtools.xxd # to dump binary stuff into a text file (used it for a ctf)
|
# unixtools.xxd # to dump binary stuff into a text file (used it for a ctf)
|
||||||
# youtube-dl # download from youtube
|
# youtube-dl # download from youtube
|
||||||
neofetch # display system information
|
neofetch # display system information
|
||||||
xclip # copy paste stuff
|
xclip # copy paste stuff
|
||||||
feh # image viewer
|
# feh # image viewer
|
||||||
unzip # for working with .zip files
|
unzip # for working with .zip files
|
||||||
speedtest-cli # test the internet speed and stuff
|
speedtest-cli # test the internet speed and stuff
|
||||||
# openssl
|
# openssl
|
||||||
# pkgconfig
|
# pkgconfig
|
||||||
# ngrok
|
# ngrok
|
||||||
hugo
|
# hugo
|
||||||
unrar
|
unrar
|
||||||
# jdk11o
|
# jdk11o
|
||||||
# jdk8
|
# jdk8
|
||||||
# gtk3
|
# gtk3
|
||||||
|
gnumake
|
||||||
|
# unison-ucm
|
||||||
|
xorg.libX11
|
||||||
|
texlive.combined.scheme-full
|
||||||
|
okular
|
||||||
|
zathura
|
||||||
|
cmake
|
||||||
|
|
||||||
# editors
|
# editors
|
||||||
# vscodium
|
# vscodium
|
||||||
|
@ -52,7 +59,7 @@
|
||||||
libreoffice # free office suite
|
libreoffice # free office suite
|
||||||
# edopro # yugioh simulator (my derivation doesn't work yet)
|
# edopro # yugioh simulator (my derivation doesn't work yet)
|
||||||
# akonadi
|
# akonadi
|
||||||
# obs-studio # video recorder
|
obs-studio # video recorder
|
||||||
# blueman # bluetooth manager
|
# blueman # bluetooth manager
|
||||||
# freesweep # minesweeper I can play w the keyboard.
|
# freesweep # minesweeper I can play w the keyboard.
|
||||||
# multimc
|
# multimc
|
||||||
|
|
5
modules/applications/xmodmap/.Xmodmap
Normal file
5
modules/applications/xmodmap/.Xmodmap
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
! Remap caps lock to control
|
||||||
|
clear lock
|
||||||
|
clear control
|
||||||
|
add control = Caps_Lock Control_L Control_R
|
||||||
|
keycode 66 = Control_L Caps_Lock NoSymbol NoSymbol
|
8
modules/applications/xmodmap/default.nix
Normal file
8
modules/applications/xmodmap/default.nix
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{ pkgs, ... }: {
|
||||||
|
home-manager.users.adrielus.home = {
|
||||||
|
packages = [ pkgs.xorg.xmodmap ];
|
||||||
|
file.".Xmodmap".source = ./.Xmodmap;
|
||||||
|
};
|
||||||
|
services.xserver.displayManager.sessionCommands =
|
||||||
|
"${pkgs.xorg.xmodmap}/bin/xmodmap .Xmodmap";
|
||||||
|
}
|
|
@ -6,8 +6,9 @@
|
||||||
./javascript.nix
|
./javascript.nix
|
||||||
./fsharp.nix
|
./fsharp.nix
|
||||||
./rust.nix
|
./rust.nix
|
||||||
./racket.nix
|
./idris.nix
|
||||||
./elm.nix
|
# ./racket.nix
|
||||||
|
# ./elm.nix
|
||||||
./dhall.nix
|
./dhall.nix
|
||||||
./haskell
|
./haskell
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
{ pkgs, ... }: {
|
{ pkgs, ... }: {
|
||||||
home-manager.users.adrielus.home.packages = with pkgs; [ dotnet-sdk mono ];
|
home-manager.users.adrielus.home.packages = with pkgs; [
|
||||||
|
dotnet-sdk
|
||||||
|
mono
|
||||||
|
packet
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
let hie = pkgs.all-hies.selection { selector = p: { inherit (p) ghc865; }; };
|
# let hie = pkgs.all-hies.selection { selector = p: { inherit (p) ghc865; }; };
|
||||||
in {
|
{
|
||||||
home-manager.users.adrielus.home = {
|
home-manager.users.adrielus.home = {
|
||||||
file.".ghci".source = ./ghci;
|
file.".ghci".source = ./ghci;
|
||||||
|
|
||||||
packages = with pkgs;
|
packages = with pkgs;
|
||||||
[ ghc ghcid hlint cabal-install snack stack ]
|
[ ghc ghcid hlint cabal-install snack stack ]
|
||||||
++ (with haskellPackages; [ brittany hoogle hpack pointfree ]);
|
++ (with haskellPackages; [ brittany hoogle hpack ]);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,6 @@
|
||||||
:def hoogle-all \str -> return $ ":! hoogle search --color " ++ show str
|
:def hoogle-all \str -> return $ ":! hoogle search --color " ++ show str
|
||||||
:def doc \str -> return $ ":! hoogle search --color --info " ++ show str
|
:def doc \str -> return $ ":! hoogle search --color --info " ++ show str
|
||||||
|
|
||||||
:def pointfree \str -> return $ ":! pointfree " ++ show str
|
-- :def pointfree \str -> return $ ":! pointfree " ++ show str
|
||||||
:def pf \str -> return $ ":! pointfree " ++ show str
|
-- :def pf \str -> return $ ":! pointfree " ++ show str
|
||||||
-- :def pointful \str -> return $ ":! pointful " ++ show str
|
-- :def pointful \str -> return $ ":! pointful " ++ show str
|
3
modules/dev/idris.nix
Normal file
3
modules/dev/idris.nix
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{ pkgs, ... }: {
|
||||||
|
home-manager.users.adrielus.home.packages = with pkgs; [ idris2 ];
|
||||||
|
}
|
|
@ -14,11 +14,12 @@ in {
|
||||||
pnpm
|
pnpm
|
||||||
yarn
|
yarn
|
||||||
|
|
||||||
tsdx
|
/* tsdx
|
||||||
mklicense
|
mklicense
|
||||||
preact-cli
|
preact-cli
|
||||||
create-next-app
|
create-next-app
|
||||||
create-snowpack-app
|
create-snowpack-app
|
||||||
bower
|
bower
|
||||||
|
*/
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,12 +27,15 @@ in {
|
||||||
|
|
||||||
# unstable stuff
|
# unstable stuff
|
||||||
brave = unstable.brave;
|
brave = unstable.brave;
|
||||||
|
idris2 = unstable.idris2;
|
||||||
ngrok = unstable.ngrok;
|
ngrok = unstable.ngrok;
|
||||||
vscodium = unstable.vscodium;
|
vscodium = unstable.vscodium;
|
||||||
|
vscode = unstable.vscode;
|
||||||
docker-compose = unstable.docker-compose;
|
docker-compose = unstable.docker-compose;
|
||||||
deno = unstable.deno;
|
deno = unstable.deno;
|
||||||
|
# discord = unstable.discord;
|
||||||
discord-canary = unstable.discord-canary;
|
discord-canary = unstable.discord-canary;
|
||||||
dotnet-sdk = dotnet-sdk_3;
|
dotnet-sdk = unstable.dotnet-sdk_5;
|
||||||
elm-repl = unstable.haskellPackages.elm-repl;
|
elm-repl = unstable.haskellPackages.elm-repl;
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
|
@ -5,10 +5,10 @@
|
||||||
"homepage": "",
|
"homepage": "",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "NUR",
|
"repo": "NUR",
|
||||||
"rev": "05a29a61a994685404ce141957c99ac65628ec25",
|
"rev": "cfe9e2e5ae53250337b0ffb3f39b477ca09cd232",
|
||||||
"sha256": "143nh2ag1dj67vg66wdmkscxa7xfic7balxg0hvymvhzzp18rbw2",
|
"sha256": "1zr8mcxp6gpiv7hy7g94giry0gfak8rbvmsi4f8vrry0jvvhp8x7",
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://github.com/nix-community/NUR/archive/05a29a61a994685404ce141957c99ac65628ec25.tar.gz",
|
"url": "https://github.com/nix-community/NUR/archive/cfe9e2e5ae53250337b0ffb3f39b477ca09cd232.tar.gz",
|
||||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
||||||
},
|
},
|
||||||
"agnoster": {
|
"agnoster": {
|
||||||
|
@ -17,10 +17,10 @@
|
||||||
"homepage": null,
|
"homepage": null,
|
||||||
"owner": "oh-my-fish",
|
"owner": "oh-my-fish",
|
||||||
"repo": "theme-agnoster",
|
"repo": "theme-agnoster",
|
||||||
"rev": "99d4e9f1b6bb1c828155495bddf3e0f0516e35f1",
|
"rev": "43860ce1536930bca689470e26083b0a5b7bd6ae",
|
||||||
"sha256": "0vyg30zi3xhl7m2y40ihb7ikwifz5ifq5wq0y58rz9hpb19wf8ws",
|
"sha256": "16k94hz3s6wayass6g1lhlcjmbpf2w8mzx90qrrqp120h80xwp25",
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://github.com/oh-my-fish/theme-agnoster/archive/99d4e9f1b6bb1c828155495bddf3e0f0516e35f1.tar.gz",
|
"url": "https://github.com/oh-my-fish/theme-agnoster/archive/43860ce1536930bca689470e26083b0a5b7bd6ae.tar.gz",
|
||||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
||||||
},
|
},
|
||||||
"all-hies": {
|
"all-hies": {
|
||||||
|
@ -29,10 +29,10 @@
|
||||||
"homepage": "",
|
"homepage": "",
|
||||||
"owner": "Infinisil",
|
"owner": "Infinisil",
|
||||||
"repo": "all-hies",
|
"repo": "all-hies",
|
||||||
"rev": "09ba836904fa290b5e37d5403150ea0c921661fb",
|
"rev": "2364c7bdf5eec60a4765486d16f9ae6be5cd8a78",
|
||||||
"sha256": "0qbjqv1fkhkx1cffqybz1mfks1jphh0vh3zd8ad2qd6lch4gyys4",
|
"sha256": "083k1xxjpdgfkbvadbw6sdbll52807iwzs1fsy1b5axjijsc5qgh",
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://github.com/Infinisil/all-hies/archive/09ba836904fa290b5e37d5403150ea0c921661fb.tar.gz",
|
"url": "https://github.com/Infinisil/all-hies/archive/2364c7bdf5eec60a4765486d16f9ae6be5cd8a78.tar.gz",
|
||||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
||||||
},
|
},
|
||||||
"cached-nix-shell": {
|
"cached-nix-shell": {
|
||||||
|
@ -41,10 +41,10 @@
|
||||||
"homepage": "",
|
"homepage": "",
|
||||||
"owner": "xzfc",
|
"owner": "xzfc",
|
||||||
"repo": "cached-nix-shell",
|
"repo": "cached-nix-shell",
|
||||||
"rev": "48dbef37bec653e23c1801cea3979f053e10654b",
|
"rev": "8b87dc0047f35fec4f7a132d0e1b67d0526a22f5",
|
||||||
"sha256": "0w6khry1ncyqy5h6996xw1f6viw4wdrfji5m8lz9gm487xlq5v0b",
|
"sha256": "1cryshs5w67xg8j3dsy3z4ia6hxzdv6jzz25jwd1m27jci4035qy",
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://github.com/xzfc/cached-nix-shell/archive/48dbef37bec653e23c1801cea3979f053e10654b.tar.gz",
|
"url": "https://github.com/xzfc/cached-nix-shell/archive/8b87dc0047f35fec4f7a132d0e1b67d0526a22f5.tar.gz",
|
||||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
||||||
},
|
},
|
||||||
"easy-dhall-nix": {
|
"easy-dhall-nix": {
|
||||||
|
@ -53,10 +53,10 @@
|
||||||
"homepage": "",
|
"homepage": "",
|
||||||
"owner": "justinwoo",
|
"owner": "justinwoo",
|
||||||
"repo": "easy-dhall-nix",
|
"repo": "easy-dhall-nix",
|
||||||
"rev": "3e9101c5dfd69a9fc28fe4998aff378f91bfcb64",
|
"rev": "1f6eecab5c276a59858a10bbfcbbc5611187da03",
|
||||||
"sha256": "1nsn1n4sx4za6jipcid1293rdw8lqgj9097s0khiij3fz0bzhrg9",
|
"sha256": "07n7y93xfiwr82yx2v8r5mxcafsxgs1hdl1ghq6xah5v827fb6q0",
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://github.com/justinwoo/easy-dhall-nix/archive/3e9101c5dfd69a9fc28fe4998aff378f91bfcb64.tar.gz",
|
"url": "https://github.com/justinwoo/easy-dhall-nix/archive/1f6eecab5c276a59858a10bbfcbbc5611187da03.tar.gz",
|
||||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
||||||
},
|
},
|
||||||
"easy-purescript-nix": {
|
"easy-purescript-nix": {
|
||||||
|
@ -65,10 +65,10 @@
|
||||||
"homepage": "",
|
"homepage": "",
|
||||||
"owner": "justinwoo",
|
"owner": "justinwoo",
|
||||||
"repo": "easy-purescript-nix",
|
"repo": "easy-purescript-nix",
|
||||||
"rev": "7ff5a12af5750f94d0480059dba0ba6b82c6c452",
|
"rev": "47bdc016c7d56e987ca1aca690b1d6c9816a8584",
|
||||||
"sha256": "0af25dqhs13ii4mx9jjkx2pww4ddbs741vb5gfc5ckxb084d69fq",
|
"sha256": "051fzxd03y0c63sll2bhn0h66dywy9lw6ylyh5vq8fymvix20q94",
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://github.com/justinwoo/easy-purescript-nix/archive/7ff5a12af5750f94d0480059dba0ba6b82c6c452.tar.gz",
|
"url": "https://github.com/justinwoo/easy-purescript-nix/archive/47bdc016c7d56e987ca1aca690b1d6c9816a8584.tar.gz",
|
||||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
||||||
},
|
},
|
||||||
"home-manager": {
|
"home-manager": {
|
||||||
|
@ -77,10 +77,10 @@
|
||||||
"homepage": "https://rycee.gitlab.io/home-manager/",
|
"homepage": "https://rycee.gitlab.io/home-manager/",
|
||||||
"owner": "rycee",
|
"owner": "rycee",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "318bc0754ed6370cfcae13183a7f13f7aa4bc73f",
|
"rev": "e6f96b6aa3e99495f9f6f3488ecf78dd316e5bec",
|
||||||
"sha256": "0hgn85yl7gixw1adjfa9nx8axmlpw5y1883lzg3zigknx6ff5hsr",
|
"sha256": "1xvxqw5cldlhcl7xsbw11n2s3x1h2vmbm1b9b69a641rzj3srg11",
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://github.com/rycee/home-manager/archive/318bc0754ed6370cfcae13183a7f13f7aa4bc73f.tar.gz",
|
"url": "https://github.com/rycee/home-manager/archive/e6f96b6aa3e99495f9f6f3488ecf78dd316e5bec.tar.gz",
|
||||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
||||||
},
|
},
|
||||||
"niv": {
|
"niv": {
|
||||||
|
@ -89,10 +89,10 @@
|
||||||
"homepage": "https://github.com/nmattia/niv",
|
"homepage": "https://github.com/nmattia/niv",
|
||||||
"owner": "nmattia",
|
"owner": "nmattia",
|
||||||
"repo": "niv",
|
"repo": "niv",
|
||||||
"rev": "303f442c43f918bc43400ab4a0b662a82ca7748b",
|
"rev": "e0ca65c81a2d7a4d82a189f1e23a48d59ad42070",
|
||||||
"sha256": "19z1qypd6zd4qzhrhjm7j55v85fzf8wln8l9vslvn9dpspcwxv7c",
|
"sha256": "1pq9nh1d8nn3xvbdny8fafzw87mj7gsmp6pxkdl65w2g18rmcmzx",
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://github.com/nmattia/niv/archive/303f442c43f918bc43400ab4a0b662a82ca7748b.tar.gz",
|
"url": "https://github.com/nmattia/niv/archive/e0ca65c81a2d7a4d82a189f1e23a48d59ad42070.tar.gz",
|
||||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
|
@ -101,22 +101,22 @@
|
||||||
"homepage": "https://github.com/NixOS/nixpkgs",
|
"homepage": "https://github.com/NixOS/nixpkgs",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs-channels",
|
"repo": "nixpkgs-channels",
|
||||||
"rev": "0c0fe6d85b92c4e992e314bd6f9943413af9a309",
|
"rev": "6d1a044fc9ff3cc96fca5fa3ba9c158522bbf2a5",
|
||||||
"sha256": "03q0dzxpd55xmvxzr963hv3nxh57m5d7sgiw5kvhpms1hf8lwd4r",
|
"sha256": "07a3nyrj3pwl017ig0rbn5rbmbf14gl3vqggvkyrdby01726p5fg",
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://github.com/NixOS/nixpkgs-channels/archive/0c0fe6d85b92c4e992e314bd6f9943413af9a309.tar.gz",
|
"url": "https://github.com/NixOS/nixpkgs-channels/archive/6d1a044fc9ff3cc96fca5fa3ba9c158522bbf2a5.tar.gz",
|
||||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
||||||
},
|
},
|
||||||
"nixpkgs-unstable": {
|
"nixpkgs-unstable": {
|
||||||
"branch": "nixos-unstable",
|
"branch": "nixos-unstable",
|
||||||
"description": "A read-only mirror of NixOS/nixpkgs tracking the released channels. Send issues and PRs to",
|
"description": "Nix Packages collection",
|
||||||
"homepage": "https://github.com/NixOS/nixpkgs",
|
"homepage": "",
|
||||||
"owner": "nixos",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs-channels",
|
"repo": "nixpkgs",
|
||||||
"rev": "8e2b14aceb1d40c7e8b84c03a7c78955359872bb",
|
"rev": "7e567a3d092b7de69cdf5deaeb8d9526de230916",
|
||||||
"sha256": "0zzjpd9smr7rxzrdf6raw9kbj42fbvafxb5bz36lcxgv290pgsm8",
|
"sha256": "0gnbxg435pnp727gbakifqkjnf2pm7qsq2b6767rj4si4w60v96v",
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://github.com/nixos/nixpkgs-channels/archive/8e2b14aceb1d40c7e8b84c03a7c78955359872bb.tar.gz",
|
"url": "https://github.com/NixOS/nixpkgs/archive/7e567a3d092b7de69cdf5deaeb8d9526de230916.tar.gz",
|
||||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
||||||
},
|
},
|
||||||
"snack": {
|
"snack": {
|
||||||
|
@ -125,10 +125,10 @@
|
||||||
"homepage": "",
|
"homepage": "",
|
||||||
"owner": "nmattia",
|
"owner": "nmattia",
|
||||||
"repo": "snack",
|
"repo": "snack",
|
||||||
"rev": "b638463b9a7490867b44d0c33bb02e8f7ca82f29",
|
"rev": "2c490a259a7670192744021fb87bf7e430a4e7f0",
|
||||||
"sha256": "02h4f0nrjvhsm7hvmrnc4kfi5my48d7yvind0f1kq1lsrcch6iph",
|
"sha256": "1v9b9bimw2nx0f2v94hjxlmsb7s82idrpc9dvjabqm92f9yc3kx9",
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://github.com/nmattia/snack/archive/b638463b9a7490867b44d0c33bb02e8f7ca82f29.tar.gz",
|
"url": "https://github.com/nmattia/snack/archive/2c490a259a7670192744021fb87bf7e430a4e7f0.tar.gz",
|
||||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,25 +6,33 @@ let
|
||||||
# The fetchers. fetch_<type> fetches specs of type <type>.
|
# The fetchers. fetch_<type> fetches specs of type <type>.
|
||||||
#
|
#
|
||||||
|
|
||||||
fetch_file = pkgs: spec:
|
fetch_file = pkgs: name: spec:
|
||||||
if spec.builtin or true then
|
let
|
||||||
builtins_fetchurl { inherit (spec) url sha256; }
|
name' = sanitizeName name + "-src";
|
||||||
else
|
in
|
||||||
pkgs.fetchurl { inherit (spec) url sha256; };
|
if spec.builtin or true then
|
||||||
|
builtins_fetchurl { inherit (spec) url sha256; name = name'; }
|
||||||
|
else
|
||||||
|
pkgs.fetchurl { inherit (spec) url sha256; name = name'; };
|
||||||
|
|
||||||
fetch_tarball = pkgs: name: spec:
|
fetch_tarball = pkgs: name: spec:
|
||||||
let
|
let
|
||||||
ok = str: ! builtins.isNull (builtins.match "[a-zA-Z0-9+-._?=]" str);
|
name' = sanitizeName name + "-src";
|
||||||
# sanitize the name, though nix will still fail if name starts with period
|
|
||||||
name' = stringAsChars (x: if ! ok x then "-" else x) "${name}-src";
|
|
||||||
in
|
in
|
||||||
if spec.builtin or true then
|
if spec.builtin or true then
|
||||||
builtins_fetchTarball { name = name'; inherit (spec) url sha256; }
|
builtins_fetchTarball { name = name'; inherit (spec) url sha256; }
|
||||||
else
|
else
|
||||||
pkgs.fetchzip { name = name'; inherit (spec) url sha256; };
|
pkgs.fetchzip { name = name'; inherit (spec) url sha256; };
|
||||||
|
|
||||||
fetch_git = spec:
|
fetch_git = name: spec:
|
||||||
builtins.fetchGit { url = spec.repo; inherit (spec) rev ref; };
|
let
|
||||||
|
ref =
|
||||||
|
if spec ? ref then spec.ref else
|
||||||
|
if spec ? branch then "refs/heads/${spec.branch}" else
|
||||||
|
if spec ? tag then "refs/tags/${spec.tag}" else
|
||||||
|
abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!";
|
||||||
|
in
|
||||||
|
builtins.fetchGit { url = spec.repo; inherit (spec) rev; inherit ref; };
|
||||||
|
|
||||||
fetch_local = spec: spec.path;
|
fetch_local = spec: spec.path;
|
||||||
|
|
||||||
|
@ -40,11 +48,21 @@ let
|
||||||
# Various helpers
|
# Various helpers
|
||||||
#
|
#
|
||||||
|
|
||||||
|
# https://github.com/NixOS/nixpkgs/pull/83241/files#diff-c6f540a4f3bfa4b0e8b6bafd4cd54e8bR695
|
||||||
|
sanitizeName = name:
|
||||||
|
(
|
||||||
|
concatMapStrings (s: if builtins.isList s then "-" else s)
|
||||||
|
(
|
||||||
|
builtins.split "[^[:alnum:]+._?=-]+"
|
||||||
|
((x: builtins.elemAt (builtins.match "\\.*(.*)" x) 0) name)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
# The set of packages used when specs are fetched using non-builtins.
|
# The set of packages used when specs are fetched using non-builtins.
|
||||||
mkPkgs = sources:
|
mkPkgs = sources: system:
|
||||||
let
|
let
|
||||||
sourcesNixpkgs =
|
sourcesNixpkgs =
|
||||||
import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) {};
|
import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) { inherit system; };
|
||||||
hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath;
|
hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath;
|
||||||
hasThisAsNixpkgsPath = <nixpkgs> == ./.;
|
hasThisAsNixpkgsPath = <nixpkgs> == ./.;
|
||||||
in
|
in
|
||||||
|
@ -64,15 +82,27 @@ let
|
||||||
|
|
||||||
if ! builtins.hasAttr "type" spec then
|
if ! builtins.hasAttr "type" spec then
|
||||||
abort "ERROR: niv spec ${name} does not have a 'type' attribute"
|
abort "ERROR: niv spec ${name} does not have a 'type' attribute"
|
||||||
else if spec.type == "file" then fetch_file pkgs spec
|
else if spec.type == "file" then fetch_file pkgs name spec
|
||||||
else if spec.type == "tarball" then fetch_tarball pkgs name spec
|
else if spec.type == "tarball" then fetch_tarball pkgs name spec
|
||||||
else if spec.type == "git" then fetch_git spec
|
else if spec.type == "git" then fetch_git name spec
|
||||||
else if spec.type == "local" then fetch_local spec
|
else if spec.type == "local" then fetch_local spec
|
||||||
else if spec.type == "builtin-tarball" then fetch_builtin-tarball name
|
else if spec.type == "builtin-tarball" then fetch_builtin-tarball name
|
||||||
else if spec.type == "builtin-url" then fetch_builtin-url name
|
else if spec.type == "builtin-url" then fetch_builtin-url name
|
||||||
else
|
else
|
||||||
abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}";
|
abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}";
|
||||||
|
|
||||||
|
# If the environment variable NIV_OVERRIDE_${name} is set, then use
|
||||||
|
# the path directly as opposed to the fetched source.
|
||||||
|
replace = name: drv:
|
||||||
|
let
|
||||||
|
saneName = stringAsChars (c: if isNull (builtins.match "[a-zA-Z0-9]" c) then "_" else c) name;
|
||||||
|
ersatz = builtins.getEnv "NIV_OVERRIDE_${saneName}";
|
||||||
|
in
|
||||||
|
if ersatz == "" then drv else
|
||||||
|
# this turns the string into an actual Nix path (for both absolute and
|
||||||
|
# relative paths)
|
||||||
|
if builtins.substring 0 1 ersatz == "/" then /. + ersatz else /. + builtins.getEnv "PWD" + "/${ersatz}";
|
||||||
|
|
||||||
# Ports of functions for older nix versions
|
# Ports of functions for older nix versions
|
||||||
|
|
||||||
# a Nix version of mapAttrs if the built-in doesn't exist
|
# a Nix version of mapAttrs if the built-in doesn't exist
|
||||||
|
@ -89,25 +119,29 @@ let
|
||||||
|
|
||||||
# https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L269
|
# https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L269
|
||||||
stringAsChars = f: s: concatStrings (map f (stringToCharacters s));
|
stringAsChars = f: s: concatStrings (map f (stringToCharacters s));
|
||||||
|
concatMapStrings = f: list: concatStrings (map f list);
|
||||||
concatStrings = builtins.concatStringsSep "";
|
concatStrings = builtins.concatStringsSep "";
|
||||||
|
|
||||||
|
# https://github.com/NixOS/nixpkgs/blob/8a9f58a375c401b96da862d969f66429def1d118/lib/attrsets.nix#L331
|
||||||
|
optionalAttrs = cond: as: if cond then as else {};
|
||||||
|
|
||||||
# fetchTarball version that is compatible between all the versions of Nix
|
# fetchTarball version that is compatible between all the versions of Nix
|
||||||
builtins_fetchTarball = { url, name, sha256 }@attrs:
|
builtins_fetchTarball = { url, name ? null, sha256 }@attrs:
|
||||||
let
|
let
|
||||||
inherit (builtins) lessThan nixVersion fetchTarball;
|
inherit (builtins) lessThan nixVersion fetchTarball;
|
||||||
in
|
in
|
||||||
if lessThan nixVersion "1.12" then
|
if lessThan nixVersion "1.12" then
|
||||||
fetchTarball { inherit name url; }
|
fetchTarball ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; }))
|
||||||
else
|
else
|
||||||
fetchTarball attrs;
|
fetchTarball attrs;
|
||||||
|
|
||||||
# fetchurl version that is compatible between all the versions of Nix
|
# fetchurl version that is compatible between all the versions of Nix
|
||||||
builtins_fetchurl = { url, sha256 }@attrs:
|
builtins_fetchurl = { url, name ? null, sha256 }@attrs:
|
||||||
let
|
let
|
||||||
inherit (builtins) lessThan nixVersion fetchurl;
|
inherit (builtins) lessThan nixVersion fetchurl;
|
||||||
in
|
in
|
||||||
if lessThan nixVersion "1.12" then
|
if lessThan nixVersion "1.12" then
|
||||||
fetchurl { inherit url; }
|
fetchurl ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; }))
|
||||||
else
|
else
|
||||||
fetchurl attrs;
|
fetchurl attrs;
|
||||||
|
|
||||||
|
@ -119,14 +153,15 @@ let
|
||||||
then abort
|
then abort
|
||||||
"The values in sources.json should not have an 'outPath' attribute"
|
"The values in sources.json should not have an 'outPath' attribute"
|
||||||
else
|
else
|
||||||
spec // { outPath = fetch config.pkgs name spec; }
|
spec // { outPath = replace name (fetch config.pkgs name spec); }
|
||||||
) config.sources;
|
) config.sources;
|
||||||
|
|
||||||
# The "config" used by the fetchers
|
# The "config" used by the fetchers
|
||||||
mkConfig =
|
mkConfig =
|
||||||
{ sourcesFile ? ./sources.json
|
{ sourcesFile ? if builtins.pathExists ./sources.json then ./sources.json else null
|
||||||
, sources ? builtins.fromJSON (builtins.readFile sourcesFile)
|
, sources ? if isNull sourcesFile then {} else builtins.fromJSON (builtins.readFile sourcesFile)
|
||||||
, pkgs ? mkPkgs sources
|
, system ? builtins.currentSystem
|
||||||
|
, pkgs ? mkPkgs sources system
|
||||||
}: rec {
|
}: rec {
|
||||||
# The sources, i.e. the attribute set of spec name to spec
|
# The sources, i.e. the attribute set of spec name to spec
|
||||||
inherit sources;
|
inherit sources;
|
||||||
|
@ -134,5 +169,6 @@ let
|
||||||
# The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers
|
# The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
};
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); }
|
mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); }
|
||||||
|
|
Loading…
Reference in a new issue