initial changes to upgrade to flakes

This commit is contained in:
Salar Rahmanian 2022-08-07 22:50:23 -07:00
parent 7194bbdb83
commit cc0fd60226
4 changed files with 159 additions and 74 deletions

35
darwin-configuration.nix Normal file
View file

@ -0,0 +1,35 @@
{ pkgs, nix, nixpkgs, config, lib, ... }:
{
environment.systemPackages = with pkgs;
[
home-manager
];
fonts = {
fontDir.enable = true;
fonts = with pkgs; [
fira-code
];
};
programs.fish.enable = true;
system.stateVersion = 4;
users = {
users.salar = {
home = /Users/salar;
};
};
nix = {
nixPath = lib.mkForce [
"nixpkgs=${nixpkgs}"
];
package = pkgs.nixUnstable;
extraOptions = ''
experimental-features = nix-command flakes
'';
distributedBuilds = false;
};
services.nix-daemon.enable = true;
}

34
flake.nix Normal file
View file

@ -0,0 +1,34 @@
{
description = "Nix and home-manager configurations for Softinio's macbook";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nur.url = github:nix-community/nur;
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
darwin = {
url = "github:lnl7/nix-darwin/master";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {darwin, home-manager, nur, nixpkgs, ...}:
let
homeManagerConfFor = config: { ... }: {
nixpkgs.overlays = [ nur.overlay ];
imports = [ config ];
};
darwinSystem = darwin.lib.darwinSystem {
system = "x86_64-darwin";
modules = [
./darwin-configuration.nix
home-manager.darwinModules.home-manager {
home-manager.users.salar = homeManagerConfFor ./home.nix;
}
];
specialArgs = { inherit nixpkgs; };
};
in {
defaultPackage.x86_64-darwin = darwinSystem.system;
};
}

136
home.nix
View file

@ -8,9 +8,9 @@
nixpkgs.overlays = [
(import ./overlays/sumneko-lua-language-server)
(import (builtins.fetchTarball {
url = https://github.com/nix-community/neovim-nightly-overlay/archive/master.tar.gz;
}))
# (import (builtins.fetchTarball {
# url = https://github.com/nix-community/neovim-nightly-overlay/archive/master.tar.gz;
# }))
];
home = {
@ -21,6 +21,71 @@
EDITOR = "nvim";
VISUAL = "$EDITOR";
};
packages = with pkgs; [
( python39.withPackages (ps: with ps; [ pip flake8 black ]) )
adoptopenjdk-bin
any-nix-shell
aspell
bloop
cabal-install
cachix
cmake
coursier
curlFull
exa
fd
ffmpeg
gitAndTools.diff-so-fancy
gnupg
go
haskellPackages.implicit-hie
hugo
lazydocker
luajit
luajitPackages.luarocks
luajitPackages.luasocket
lorri
maven
multimarkdown
mypy
ncdu
neofetch
neovim
niv
nix-index
nixfmt
nodePackages.pyright
nodePackages.typescript-language-server
nodePackages.vscode-html-languageserver-bin
nodePackages.vscode-json-languageserver
nodePackages.yaml-language-server
openssl
pandoc
patchelf
poetry
procs
rclone
readline
ripgrep
ripgrep-all
rnix-lsp
rustup
sbt
scala-cli
shellcheck
sqlite
stylua
stack
# sumneko-lua-language-server
tealdeer
tig
tokei
tree
tree-sitter
wget
xz
yq
];
};
programs.bat = {
@ -29,7 +94,6 @@
programs.direnv = {
enable = true;
enableFishIntegration = true;
nix-direnv.enable = true;
};
@ -218,7 +282,7 @@
v="nvim";
tabninecfg="vc /Users/salar/Library/Preferences/TabNine/TabNine.toml";
sshfre1="ssh salar@fre1.softinio.net";
sshfre2="ssh salar@fre2.softinio.net";
sshfre2="ssh -p 2022 salar@fre2.softinio.net";
};
};
@ -231,66 +295,4 @@
# Neovim Configuration
xdg.configFile."nvim/lua/salargalaxyline.lua".source = programs/neovim/settings/salargalaxyline.lua;
xdg.configFile."nvim/init.lua".source = programs/neovim/init.lua;
home.packages = [
pkgs.adoptopenjdk-bin
pkgs.any-nix-shell
pkgs.aspell
pkgs.bloop
pkgs.cmake
pkgs.coursier
pkgs.curlFull
pkgs.direnv
pkgs.dust
pkgs.exa
pkgs.fd
pkgs.ffmpeg
pkgs.gitAndTools.diff-so-fancy
pkgs.global
pkgs.gnupg
pkgs.go
pkgs.hugo
pkgs.jansson
pkgs.luajit
pkgs.luajitPackages.luarocks
pkgs.luajitPackages.luasocket
pkgs.maven
pkgs.multimarkdown
pkgs.ncdu
pkgs.neofetch
pkgs.neovim
pkgs.niv
pkgs.nixFlakes
pkgs.nixfmt
pkgs.nodePackages.pyright
pkgs.nodePackages.typescript-language-server
pkgs.nodePackages.vscode-html-languageserver-bin
pkgs.nodePackages.vscode-json-languageserver
pkgs.nodePackages.yaml-language-server
pkgs.openssl
pkgs.pandoc
pkgs.prettyping
pkgs.procs
pkgs.python3Full
pkgs.python39Packages.debugpy
pkgs.readline
pkgs.ripgrep
pkgs.ripgrep-all
pkgs.rnix-lsp
pkgs.rustup
pkgs.sbt
pkgs.scala-cli
pkgs.shellcheck
pkgs.stylua
pkgs.sumneko-lua-language-server
pkgs.tealdeer
pkgs.tig
pkgs.tokei
pkgs.tree
pkgs.tree-sitter
pkgs.universal-ctags
pkgs.wget
pkgs.xz
pkgs.yq
];
}

View file

@ -7,6 +7,7 @@ let
pager = "diff-so-fancy | less --tabs=4 -RFX";
};
init.defaultBranch = "main";
merge.conflictStyle = "diff3";
merge.tool = "intellij";
mergetool = {
cmd = "idea merge \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\"";
@ -23,20 +24,24 @@ let
insteadOf = "https://github.com/";
};
};
fetch.prune = true;
pull = {
rebase = true;
};
};
in
{
programs.git = {
enable = true;
userEmail = "code@softinio.com";
userName = "Salar Rahmanian";
ignores = [
myAliases = {
ci = "commit";
co = "checkout";
main = "checkout main";
master = "checkout master";
};
myIgnores = [
"*~"
".DS_Store"
"*.bloop"
".direnv/"
".idea/"
".mypy_cache"
"*.metals"
"*.metals.sbt"
"*metals.sbt"
@ -47,7 +52,16 @@ in
"*.idea"
"*.vscode"
"*.python-version"
"result"
];
in
{
programs.git = {
enable = true;
userEmail = "code@softinio.com";
userName = "Salar Rahmanian";
aliases = myAliases;
ignores = myIgnores;
extraConfig = gitConfig;
};
}