[NixOS] Flakes sort of working

This commit is contained in:
Ivan Malison 2021-07-11 04:19:34 -06:00
parent 118ad8f3ea
commit c8ad9de976
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8
22 changed files with 448 additions and 79 deletions

View File

@ -1,8 +1,6 @@
_: pkgs: rec {
haskellPackages = pkgs.haskellPackages.override (old: {
overrides = pkgs.lib.composeExtensions (old.overrides or (_: _: {})) (self: super: rec {
xmonad = self.callCabal2nix "xmonad" (fetchGit ./xmonad) { };
xmonad-contrib = self.callCabal2nix "xmonad-contrib" (fetchGit ./xmonad-contrib) { };
imalison-xmonad = self.callCabal2nix "imalison-xmonad" (
pkgs.lib.sourceByRegex ./.
[

@ -1 +1 @@
Subproject commit af354f7528ada1de451365a0f5138ef10a318360
Subproject commit b321489cfcf84d72a280ff1c60718532e319aa2c

@ -1 +1 @@
Subproject commit 7b83d924d19171f4ba98e7956a72e99ed815e022
Subproject commit ef1e37f7d8448190582e8698e8dfeecf8fbb2ec7

View File

@ -484,3 +484,7 @@ function all_after_char {
function find_local_ssh_hosts {
nmap -p 22 --open -sV 10.0.0.0/24 | grep -Eo "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}"
}
function rwhich {
readlink -f $(which $1)
}

153
nixos/all.nix Normal file
View File

@ -0,0 +1,153 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
# Applications
alacritty
# calibre
gnome3.cheese
dfeet
discord
emacs
firefox
gitter
google-chrome
hexchat
keybase-gui
kitty
kleopatra
# kodi
libreoffice
lxappearance
okular
# pulseeffects
quassel
slack
simplescreenrecorder
spotify
transmission-gtk
vlc
xfce.thunar
wire-desktop
yubikey-manager
zoom-us
# Appearance
gnome-breeze
gnome3.adwaita-icon-theme
hicolor-icon-theme
materia-theme
numix-icon-theme-circle
papirus-icon-theme
# plasma5.breeze-gtk
# plasma5.breeze-qt5
# Desktop
autorandr
betterlockscreen
blueman
clipit
feh
gnome3.gpaste
kdeconnect
libnotify
lxqt.lxqt-powermanagement
networkmanagerapplet
notify-osd-customizable
pasystray
picom
pinentry
pommed_light
rofi
rofi-pass
rofi-systemd
skippy-xd
synergy
udiskie
volnoti
# xorg
wmctrl
xclip
xdotool
xorg.xev
xorg.xkbcomp
xorg.xwininfo
xsettingsd
# Audio
pulsemixer
pavucontrol
playerctl
# Tools
automake
bind
binutils
cmake
dex
direnv
dpkg
emacs27Packages.cask
fd
file
gcc
gdb
gitAndTools.git-crypt
gitAndTools.git-extras
gitAndTools.git-fame
gitAndTools.git-sync
gitAndTools.hub
gitFull
glxinfo
gnumake
gnupg
gparted
htop
inetutils
inotify-tools
ispell
jq
libtool
# lorri
lsof
mercurial
ncdu
neofetch
openvpn
parallel
pass
patchelf
pciutils
plasma-workspace
pijul
powertop
prometheus
pscircle
pstree
qt5.qttools
rcm
# rr
scrot
silver-searcher
stow
subversion
swig
tmux
tzupdate
unzip
usbutils
valgrind
wget
yubikey-manager
# Nix
nix-prefetch-git
cachix
# Miscellaneous
android-udev-rules
librsvg
];
}

5
nixos/android.nix Normal file
View File

@ -0,0 +1,5 @@
{ pkgs, ... }:
{
nixpkgs.config.android_sdk.accept_license = true;
programs.adb.enable = true;
}

12
nixos/appearance.nix Normal file
View File

@ -0,0 +1,12 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
# Appearance
gnome-breeze
gnome3.adwaita-icon-theme
hicolor-icon-theme
materia-theme
numix-icon-theme-circle
papirus-icon-theme
];
}

View File

@ -3,12 +3,12 @@
imports = [
./users.nix
# ./fonts.nix
./essential-packages.nix
./essential.nix
./flakes.nix
];
nixpkgs.overlays = [
(import ./overlays.nix)
(import ../dotfiles/config/taffybar/taffybar/overlay.nix)
(import ../dotfiles/config/xmonad/overlay.nix)
(import ../dotfiles/config/taffybar/overlay.nix)
];

44
nixos/code.nix Normal file
View File

@ -0,0 +1,44 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
# Haskell
cabal-install
cabal2nix
ghc
# stack
haskellPackages.hpack
haskellPackages.hasktags
haskellPackages.hoogle
# (all-hies.selection { selector = p: { inherit (p) ghc864 ghc865; }; })
# Scala
sbt
scala
# Node
nodePackages.npm
nodejs
# Rust
cargo
carnix
# rls
rustc
rustfmt
# Clojure
boot
leiningen
# Ruby
ruby
# purescript
purescript
spago
# dhall
haskellPackages.dhall
haskellPackages.dhall-json
];
}

View File

@ -0,0 +1,8 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
spotify
google-chrome
pommed_light
];
}

158
nixos/flake.lock Normal file
View File

@ -0,0 +1,158 @@
{
"nodes": {
"gitIgnoreSource": {
"inputs": {
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1625992881,
"narHash": "sha256-eCezVMt2pyTzMFQAPgkUotoCtm2/r36v3MsCBIaaDTo=",
"owner": "IvanMalison",
"repo": "gitignore.nix",
"rev": "af0dc0884813e837d5e3025daaba212792c62da0",
"type": "github"
},
"original": {
"owner": "IvanMalison",
"ref": "master",
"repo": "gitignore.nix",
"type": "github"
}
},
"nixos-hardware": {
"locked": {
"lastModified": 1625333638,
"narHash": "sha256-M6J9RN60XJyv6nUfDFCwnz5aVjhe8+GJnV8Q9VpdQQQ=",
"owner": "nixos",
"repo": "nixos-hardware",
"rev": "41775780a0b6b32b3d32dcc32bb9bc6df809062d",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixos-hardware",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1625977875,
"narHash": "sha256-rI9IhR2aKTQoknUXAa13/OlVzmthN3Ai7YNYzVvslO4=",
"owner": "IvanMalison",
"repo": "nixpkgs",
"rev": "b6eeca1e7322e74520eb518cebda8c9596dd55b9",
"type": "github"
},
"original": {
"owner": "IvanMalison",
"ref": "my-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"narHash": "sha256-2VpqiYwgoTLYeQnNz+YbMdtGrQQkjZjEH0UqVl5vm2s=",
"path": "/home/imalison/Projects/nixpkgs",
"type": "path"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs_3": {
"locked": {
"narHash": "sha256-2VpqiYwgoTLYeQnNz+YbMdtGrQQkjZjEH0UqVl5vm2s=",
"path": "/home/imalison/Projects/nixpkgs",
"type": "path"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs_4": {
"locked": {
"lastModified": 1625997078,
"narHash": "sha256-Ba3eO3gol+zFdX6zW3xiNey7giJ28VKhKq+U8hvZWfM=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1ba95cc7c9c4240b78661f130bee38f90835bea0",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs_5": {
"locked": {
"lastModified": 1625997078,
"narHash": "sha256-Ba3eO3gol+zFdX6zW3xiNey7giJ28VKhKq+U8hvZWfM=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1ba95cc7c9c4240b78661f130bee38f90835bea0",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"root": {
"inputs": {
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs",
"taffybar": "taffybar",
"xmonad": "xmonad",
"xmonad-contrib": "xmonad-contrib"
}
},
"taffybar": {
"inputs": {
"gitIgnoreSource": "gitIgnoreSource",
"nixpkgs": "nixpkgs_3"
},
"locked": {
"narHash": "sha256-A6x2734T9WHViDZNMQ91g+egDeM2FGEv3Ngx7DfOjIc=",
"path": "../dotfiles/config/taffybar/taffybar",
"type": "path"
},
"original": {
"path": "../dotfiles/config/taffybar/taffybar",
"type": "path"
}
},
"xmonad": {
"inputs": {
"nixpkgs": "nixpkgs_4"
},
"locked": {
"narHash": "sha256-uyUYdDfz61AFZOj27IJHq1hGh4I4H8WahsenjKn/QRg=",
"path": "../dotfiles/config/xmonad/xmonad",
"type": "path"
},
"original": {
"path": "../dotfiles/config/xmonad/xmonad",
"type": "path"
}
},
"xmonad-contrib": {
"inputs": {
"nixpkgs": "nixpkgs_5"
},
"locked": {
"narHash": "sha256-U+FcJ5c1EDc1ce0gbHyhiK5XFI1e9+HTwfRqxktPJts=",
"path": "../dotfiles/config/xmonad/xmonad-contrib",
"type": "path"
},
"original": {
"path": "../dotfiles/config/xmonad/xmonad-contrib",
"type": "path"
}
}
},
"root": "root",
"version": 7
}

34
nixos/flake.nix Normal file
View File

@ -0,0 +1,34 @@
{
inputs = {
nixpkgs = {
url = github:IvanMalison/nixpkgs/my-unstable;
};
taffybar = {
url = path:../dotfiles/config/taffybar/taffybar;
};
xmonad-contrib = {
url = path:../dotfiles/config/xmonad/xmonad-contrib;
};
xmonad = {
url = path:../dotfiles/config/xmonad/xmonad;
};
nixos-hardware.url = github:nixos/nixos-hardware;
};
outputs = { self, nixpkgs, nixos-hardware, taffybar, xmonad, xmonad-contrib }:
let tweaks = ({...}: {
nix.registry.nixpkgs.flake = nixpkgs;
nixpkgs.overlays = [ taffybar.overlay xmonad.overlay xmonad-contrib.overlay ];
});
in
{
nixosConfigurations = {
ryzen-shine = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [ tweaks ./machines/ryzen-shine.nix ];
};
biskcomp = nixpkgs.lib.nixosSystem {
modules = [ tweaks ./machines/biskcomp.nix ];
};
};
};
}

9
nixos/flakes.nix Normal file
View File

@ -0,0 +1,9 @@
{ pkgs, nixpkgs, ... }:
{
nix = {
package = pkgs.nixUnstable;
extraOptions = ''
experimental-features = nix-command flakes
'';
};
}

10
nixos/full.nix Normal file
View File

@ -0,0 +1,10 @@
{ pkgs, ... }:
{
imports = [
./all.nix
./android.nix
./base.nix
./code.nix
./essential-no-arm.nix
];
}

View File

@ -1,7 +1,7 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
ic-keysmith
quill
# ic-keysmith
# quill
];
}

View File

@ -6,7 +6,7 @@
{
imports =
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
../minimal.nix
../base.nix
];
system.stateVersion = "20.03";

View File

@ -3,7 +3,7 @@
{
imports = [
<nixpkgs/nixos/modules/installer/scan/not-detected.nix>
../configuration.nix
../full.nix
../cachix.nix
];

View File

@ -6,10 +6,9 @@
{
imports = [
<nixpkgs/nixos/modules/installer/scan/not-detected.nix>
../configuration.nix
../full.nix
../extra.nix
../dfinity.nix
/etc/nixos/cachix.nix
];
# disable card with bbswitch by default since we turn it on only on demand!

View File

@ -5,8 +5,7 @@
{
imports = [
<nixpkgs/nixos/modules/installer/scan/not-detected.nix>
../configuration.nix
../full.nix
../dfinity.nix
];

View File

@ -3,7 +3,7 @@
{
imports = [
<nixpkgs/nixos/modules/installer/scan/not-detected.nix>
../configuration.nix
../full.nix
../games.nix
../extra.nix
];

View File

@ -1,67 +1,3 @@
self: super:
let
lorriSource = (import <nixpkgs> {}).fetchurl {
url = "https://raw.githubusercontent.com/target/lorri/master/direnv/nixos.nix";
sha256 = "057kqbivf4xbhakz1j1b19sxd5c6p6rqhg6pwnq2zfvvmp8nmylm";
};
lorriBinSource = super.fetchFromGitHub {
owner = "IvanMalison";
repo = "lorri";
rev = "cb966b0d4ab7f4b5861d79a19822eca6b6a50e82";
sha256 = "1q01cjmvd1shxlwzjsi4gzdn0sx5a132bqql3xksbnhaj7ka6j3f";
};
in
{
lorri = (import (lorriBinSource.outPath + "/default.nix")) { pkgs = super; };
ic-keysmith = self.buildGoModule rec {
pname = "keysmith";
version = "1.6.0";
src = super.fetchFromGitHub {
owner = "dfinity";
repo = "keysmith";
rev = "v${version}";
sha256 = "1z0sxirk71yabgilq8v5lz4nd2bbm1xyrd5zppif8k9jqhr6v3v3";
};
vendorSha256 = "1qnj1x8ydnbw5zb3hrsd1pd2lh3qbd340sbsjyrhcrksl1hdrrax";
runVend = true;
};
quill = with self; rustPlatform.buildRustPackage rec {
name = "quill-${version}";
version = "0baa53c175";
src = fetchFromGitHub {
owner = "dfinity";
repo = "quill";
rev = "6f3117c2b97195eb2b0059011063929553bc18ea";
sha256 = "1nr31jmhx1hnqba6n5dk8qal9r843lwss6ldcdyvwz4cmybndnna";
# date = 2021-06-18T08:16:07+02:00;
};
ic = fetchFromGitHub {
owner = "dfinity";
repo = "ic";
rev = "779549eccfcf61ac702dfc2ee6d76ffdc2db1f7f";
sha256 = "1r31d5hab7k1n60a7y8fw79fjgfq04cgj9krwa6r9z4isi3919v6";
};
registry = "file://local-registry";
preBuild = ''
export REGISTRY_TRANSPORT_PROTO_INCLUDES=${ic}/rs/registry/transport/proto
export IC_BASE_TYPES_PROTO_INCLUDES=${ic}/rs/types/base_types/proto
export IC_PROTOBUF_PROTO_INCLUDES=${ic}/rs/protobuf/def
export IC_NNS_COMMON_PROTO_INCLUDES=${ic}/rs/nns/common/proto
export PROTOC=${protobuf}/bin/protoc
'';
cargoSha256 = "0h756lkvyqwsw3984dm0ys6qrdl22isg2zh2mmzqyw8220fgdzph";
nativeBuildInputs = [ pkg-config protobuf ];
buildInputs = [ openssl protobuf ];
};
}